forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
0
ui_events/Bundled/canvas/MyCanvas.files
Normal file
0
ui_events/Bundled/canvas/MyCanvas.files
Normal file
1
ui_events/Bundled/canvas/MyCanvas.json
Normal file
1
ui_events/Bundled/canvas/MyCanvas.json
Normal file
@ -0,0 +1 @@
|
||||
{"name":"untitled","x":0,"y":0,"width":960,"height":540,"elements":[{"id":1,"type":2,"name":"Button","event":"move_box","x":20,"y":20,"width":201,"height":57,"text":"Move Box","asset":"","color":-1,"anchor":0,"children":[],"visible":true,"rotation":0}],"assets":[],"theme":"Default Light"}
|
||||
1
ui_events/README.md
Normal file
1
ui_events/README.md
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/leenkx3d/leenkx/wiki/ui_editor
|
||||
16
ui_events/Sources/lnx/MyTrait.hx
Normal file
16
ui_events/Sources/lnx/MyTrait.hx
Normal file
@ -0,0 +1,16 @@
|
||||
package lnx;
|
||||
|
||||
class MyTrait extends iron.Trait {
|
||||
public function new() {
|
||||
super();
|
||||
leenkx.system.Event.add("move_box", onEvent);
|
||||
}
|
||||
|
||||
function onEvent() {
|
||||
trace("move_box");
|
||||
var loc = object.transform.loc;
|
||||
loc.y += 1;
|
||||
if (loc.y > 4) loc.y -= 8;
|
||||
object.transform.buildMatrix();
|
||||
}
|
||||
}
|
||||
BIN
ui_events/ui_events.blend
Normal file
BIN
ui_events/ui_events.blend
Normal file
Binary file not shown.
Reference in New Issue
Block a user