Examples - Add Grid Size Up/Down Buttons

This commit is contained in:
Marty Oehme 2018-07-20 19:51:13 +02:00
parent d11a47abc5
commit 76b0e68cf1
2 changed files with 42 additions and 10 deletions

View file

@ -112,7 +112,19 @@ void addControls(Example ex) {
..text = "Stop"
..onClick.listen((e) {
ex.loop.stop();
})));
}))
..append(new ButtonElement()
..text = "+"
..onClick.listen((e) {
ex.loop.game.changeGridSize(true);
}))
..append(new ButtonElement()
..text = "-"
..onClick.listen((e) {
ex.loop.game.changeGridSize(false);
}))
);
// Don't add controls which don't work anyways (for simple examples)
if(examples.indexOf(ex) <= 1) return;