system.ui.joystick.<...>

Return to Introduction  Previous page  Next page

Joystick input device related functions.

 

Properties

 

x

Current x position of the joystick from -1.0 to 1.0 where 0.0 is the centre.

y

Current y position of the joystick from -1.0 to 1.0 where 0.0 is the centre.

z

Current z position of the joystick (if supported) from -1.0 to 1.0 where 0.0 is the centre.

button

Integer value represting which button(s) are down, where 1=button 1, 2 = button 2, 3 = buttons 1+2, etc.

zeroRange

Floating point value that can be set to determine how far a joystick must move along an axis before it is registered (defaults to 0.2).

rx

Rotational amount around x axis if supported from -1.0 to 1.0.

ry

Rotational amount around y axis if supported from -1.0 to 1.0.

rz

Rotational amount around z axis if supported from -1.0 to 1.0.

pov0

Floating point value for the point of view hat 0.

pov1

Floating point value for the point of view hat 1.

pov2

Floating point value for the point of view hat 2.

pov3

Floating point value for the point of view hat 3.

slider0

Floating point value for the slider 0.

slider1

Floating point value for the slider 1.

 

Methods

 

getTotalJoysticks()

Returns an integer of the total number of joysticks available to the player.

setCurrentJoystick(index)

Sets all the above properties to read from the given joystick index (0=first joystick, 1=second, etc).  Defaults to 0.

 

 

Examples

 

print("Joystick x position is: "+system.ui.joystick.x);

 

Remarks

 

All mouse x/y coordinates are in pixels.

 

See Also

 

System



Copyright ©2004 Worldweaver Ltd. DX Studio Home