Arrows control
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user