Lua API  0.4.0
Game Engine
 All Files Functions
Input.lua File Reference

Functions

 isKeyPressed (key)
 Checks, if the given key is currently pressed. More...
 
 onKeyDown (key)
 Checks, if the given key got pressed in this frame. More...
 
 onKeyUp (key)
 Checks, if the given key got released in this frame. More...
 
 getAxis (axis)
 Retrieves the current axis value of a joystick or mouse. More...
 
 getProperty (name)
 
 getTouchPosition (touchId)
 Retrieves the current touch position on touch devices. More...
 
 getLastTouchPosition (touchId)
 
 getTouchPhase (touchId)
 

Function Documentation

getAxis ( axis  )

Retrieves the current axis value of a joystick or mouse.

The value is between 0.0 and 1.0

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameters
Thename of the key.
Returns
A float value.
getLastTouchPosition ( touchId  )
getProperty ( name  )
getTouchPhase ( touchId  )
getTouchPosition ( touchId  )

Retrieves the current touch position on touch devices.

Is the same as the mouse cursor position since SDL makes no difference between them.

Parameters
Thetouch device ID
Returns
The touch position.
isKeyPressed ( key  )

Checks, if the given key is currently pressed.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameters
Thename of the key.
Returns
A boolean value.
onKeyDown ( key  )

Checks, if the given key got pressed in this frame.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameters
Thename of the key.
Returns
A boolean value.
onKeyUp ( key  )

Checks, if the given key got released in this frame.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameters
Thename of the key.
Returns
A boolean value.