GameInput
Class that contains all information about the current input during a given frame from the remote
Properties
button(string) — The name of the button associated with the current inputbuttonCode(integer) — The code for the inputpress(boolean) — Was the button pressed since the last frameheld(boolean) — Was the button held down since last framerelease(boolean) — Was the button released this frameheldTimeMs(integer) — How many milliseconds was the current input held forx(float) — Current horizontal directional input: left -> -1, right -> 1y(float) — Current vertical directional input, in world space (+y is up, matching ' the engine's world coordinate convention - the renderer flips this when ' projecting to raster/canvas space): up -> 1, down -> -1
Example
CODE
' -------Button Code Reference--------
' Button Pressed Released Held
' ------------------------------
' Back 0 100 1000
' Up 2 102 1002
' Down 3 103 1003
' Left 4 104 1004
' Right 5 105 1005
' OK 6 106 1006
' Replay 7 107 1007
' Rewind 8 108 1008
' FastForward 9 109 1009
' Options 10 110 1010
' Play 13 113 1013Constructor
new GameInput(
buttonCode: integer,
heldTimeMs: integer,
): GameInputCreates a GameInput object based on the buttonCode
Parameters
buttonCode(integer) — button to use for the dataheldTimeMs(integer) — how long was this button held for
Instance Methods
isButton(buttonName: string): boolean
Is this input for the given button name?
Parameters
buttonName(string) — the button name to check (case insensitive - e.g. "ok" is same as "OK")
Returns
boolean
isDirectionalArrow(): boolean
Is this input from the directional pad
Returns
boolean