This is an archive. | |
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure. |
Joystick Control object
Author | |
Status | Released |
Release Date | Unknown |
Available for | |
Supported Runtimes | |
License | Free |
Download | |
---|---|
Includes Examples | No |
Includes Help Files | Yes |
Links | Included by default. |
The Joystick Control object is an invisible object that allows you to manually control the joystick on an iOS, Android, HTML5, XNA, or UWP application. The joystick can be set to either be a touch joystick, or driven by the accelerometers. You can also set the position of the joystick and buttons on the screen.
Please note that for the Joystick Control object to work, you need to set the Joystick / Device property in the exporter section in the frame properties. to "Controlled by an extension". If you do not, the object will have no effect.
Contents
- 1 Actions
- 1.1 Start accelerometer joystick
- 1.2 Stop accelerometer joystick
- 1.3 Start/stop touch joystick
- 1.4 Set joystick position
- 1.5 Set joystick X coordinate
- 1.6 Set joystick Y coordinate
- 1.7 Set button 1 position
- 1.8 Set button 1 X coordinate
- 1.9 Set button 1 Y coordinate
- 1.10 Set button 2 position
- 1.11 Set button 2 X coordinate
- 1.12 Set button 2 Y coordinate
- 1.13 Set joystick mask
- 2 Expressions
Actions
Start accelerometer joystick
Starts the accelerometers and the processing of them: you will be able to move your object by orienting the device.
Stop accelerometer joystick
Interrupts the accelerometer joystick.
Start/stop touch joystick
Starts or stop the touch joystick and the fire buttons. This action asks for 4 parameters:
- Joystick
Enter 1 to display the joystick, 0 to hide it.
- Button 1
Enter 1 to display button 1, 0 to hide it.
- Button 2
Enter 1 to display button 2, 0 to hide it.
- Left handed
Enter 1 for a left-handed display (joystick on the right), 0 for right-handed.
Set joystick position
Allows you to fix the position of the joystick on the screen.
Set joystick X coordinate
Set joystick Y coordinate
Allows you to fix the X and Y coordinates of the joystick.
Set button 1 position
Allows you to fix the position of button 1 on the screen.
Set button 1 X coordinate
Set button 1 Y coordinate
Allows you to fix the X and Y coordinates of button 1.
Set button 2 position
Allows you to fix the position of button 1 on the screen.
Set button 2 X coordinate
Set button 2 Y coordinate
Allows you to fix the X and Y coordinates of button 2.
Set joystick mask
This action allows you to mask the input of the joystick. You have to provide a binary mask used to calculate a logical AND between the joystick input and the mask. The inputs are coded as following:
- %000001: top
- %000010: bottom
- %000100: left
- %001000: right
- %010000: fire 1
- %100000: fire 2
For example, a mask of 3 (%11) will only allow up and down movements...
Expressions
Touch Joystick
Retrieves the current coordinates of the joystick. A large negative number is returned if you ask for the position of the joystick when it is not displayed.
X coordinate
XJoystick( "Joystick Control object" )
Y coordinate
YJoystick( "Joystick Control object" )
Button 1
Retrieves the current coordinates of first button. A large negative number is returned if you ask for the position of the button when it is not displayed.
X coordinate
XFireOne( "Joystick Control object" )
Y coordinate
YFireOne( "Joystick Control object" )
Button 2
Retrieves the current coordinates of second button. A large negative number is returned if you ask for the position of the button when it is not displayed.
X coordinate
XFireTwo( "Joystick Control object" )
Y coordinate
YFireTwo( "Joystick Control object" )