Arrows control

This commit is contained in:
luboslenco
2019-05-19 10:52:32 +02:00
parent 5b97b54165
commit b3a395b7a9
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -221,6 +221,13 @@ class UINodes extends iron.Trait {
// trace(str.substr(0, 1023));
// trace(str.substr(1023, 2047));
// }
if (nodes.nodesSelected.length > 0) {
if (keyboard.started("left")) for (n in nodes.nodesSelected) n.x -= 1;
else if (keyboard.started("right")) for (n in nodes.nodesSelected) n.x += 1;
if (keyboard.started("up")) for (n in nodes.nodesSelected) n.y -= 1;
else if (keyboard.started("down")) for (n in nodes.nodesSelected) n.y += 1;
}
}
public function getNodeX():Int {
+7
View File
@@ -165,6 +165,8 @@ class UIView2D extends iron.Trait {
function update() {
var m = iron.system.Input.getMouse();
var kb = iron.system.Input.getKeyboard();
var headerh = ui.ELEMENT_H() * 1.4;
UITrait.inst.paint2d = false;
@@ -188,5 +190,10 @@ class UIView2D extends iron.Trait {
if (type == 0 && m.down("left")) {
UITrait.inst.paint2d = true;
}
if (kb.started("left")) panX -= 5;
else if (kb.started("right")) panX += 5;
if (kb.started("up")) panY -= 5;
else if (kb.started("down")) panY += 5;
}
}