Update Getting Started authored by Moritz Brückner's avatar Moritz Brückner
......@@ -72,23 +72,25 @@ class Main {
static function initialized(window: kha.Window) {
kha.Assets.loadEverything(function() {
Koui.init();
Koui.init(() -> {
var button = new Button("Click me!");
button.setPosition(400, 180);
button.onMouseClick(function(e: Event) {
switch (e.state) {
case Active:
button.label = "Clicking";
case Deactivated:
button.label = "Clicked";
default:
button.label = "Click me!";
}
});
Koui.add(button);
});
var button = new Button("Click me!");
button.setPosition(400, 180);
button.onMouseClick(function(e: Event) {
switch (e.state) {
case Active:
button.label = "Clicking";
case Deactivated:
button.label = "Clicked";
default:
button.label = "Click me!";
}
});
Koui.add(button);
});
}
......@@ -117,23 +119,23 @@ class KouiTrait extends iron.Trait {
super();
notifyOnInit(function() {
Koui.init();
var button = new Button("Click me!");
button.setPosition(400, 180);
button.onMouseClick(function(e: Event) {
switch (e.state) {
case Active:
button.label = "Clicking";
case Deactivated:
button.label = "Clicked";
default:
button.label = "Click me!";
}
});
Koui.add(button);
Koui.init(() -> {
var button = new Button("Click me!");
button.setPosition(400, 180);
button.onMouseClick(function(e: Event) {
switch (e.state) {
case Active:
button.label = "Clicking";
case Deactivated:
button.label = "Clicked";
default:
button.label = "Click me!";
}
});
Koui.add(button);
});
});
}
}
......
......