package leenkx.logicnode; import iron.Trait; import iron.system.Input; import iron.math.Vec2; typedef Pos = { x: Int, y: Int } typedef Touch = { index:Int, pos:Pos } typedef Button = { button:Int, pos:Pos } @:access(iron.system.Input) @:access(iron.system.Gamepad) class TouchPadNode extends LogicNode { var gamepad:Gamepad; var lPad:Pos = {x:0,y:0}; var rPad:Pos = {x:0,y:0}; var lStick:Pos = {x:0,y:0}; var rStick:Pos = {x:0,y:0}; var lStickLast:Pos = {x:0,y:0}; var rStickLast:Pos = {x:0,y:0}; var leftLocked = -1; var rightLocked = -1; var button_pos:Pos = {x:0,y:0}; public var buttonOffset = 120; public var buttonRadius = 50; @prop public var stickRadius = 100; // stickRadius @prop public var stickOffset = 40; // stickOffset var touches:Array = []; var buttons:Array