Difference between revisions of "PlugIn Development:GameEx Input Joystick Function"

From Spesoft/GameEx Wiki
Jump to navigation Jump to search
Line 1: Line 1:
This function is called when you press a button on the joystick.
This function is called when you press a button on the joystick.
You can return <span style="color:red;">'''TRUE'''</span> to continue processing the event or return <span style="color:red;">'''FALSE'''</span> and GameEx will not initialize the event.
The <span style="color:red;">'''Buttons'''</span> parameter is passed as the user presses a joystick key.
<span style="color:darkred;"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span>
<br />
<br />
== <span style="color:darkblue;">Code Examples</span> ==
<div class="note_block_red"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span></div>
<br />
== <span class="plugin_headline_text">Peramaters</span> ==
<span class="plugin_return_text">Buttons() [boolean]</span>: An array of buttons that denote the state of the buttons on the joystick.
<br />
=== <span class="plugin_text_fx">Perameter Values</span> ===
For each item in the <span class="plugin_return_text">array</span>, <span class="plugin_return_text">true</span> means that the array position's button is currently pressed.<br />
So, if <span class="plugin_return_text">Array[0] = true</span> then Joystick Button 0 is pressed, and so on.
<br />
== <span class="plugin_headline_text">Returns</span> ==
This function returns a <span class="plugin_return_text">boolean</span> value.
<br />
=== <span class="plugin_text_fx">Return Values</span> ===
Return <span class="plugin_return_text">true</span> and GameEx will process the joystick button press.<br />
Return <span class="plugin_return_text">false</span> and GameEx will not process the joystick button press.
<br />
== <span class="plugin_headline_text">Code Examples</span> ==


=== <span style="color:#003300;">VB.NET</span> ===
=== <span class="plugin_text_fx">VB.NET</span> ===
----
----
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_block_func">
Public Function Input_Joystick(ByVal Buttons() As Boolean) As Boolean
Public Function Input_Joystick(ByVal Buttons() As Boolean) As Boolean
     Return True
     Return True
End Function</pre>
End Function</pre>


=== <span style="color:#003300;">C#</span> ===
=== <span class="plugin_text_fx">C#</span> ===
----
----
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_block_func">
public bool Input_Joystick(bool[] Buttons)
public bool Input_Joystick(bool[] Buttons)
{
{

Revision as of 00:23, 28 April 2014

This function is called when you press a button on the joystick.

PLEASE NOTE: This function only fires when the GameEx UI is visible.


Peramaters

Buttons() [boolean]: An array of buttons that denote the state of the buttons on the joystick.

Perameter Values

For each item in the array, true means that the array position's button is currently pressed.
So, if Array[0] = true then Joystick Button 0 is pressed, and so on.

Returns

This function returns a boolean value.

Return Values

Return true and GameEx will process the joystick button press.
Return false and GameEx will not process the joystick button press.

Code Examples

VB.NET


Public Function Input_Joystick(ByVal Buttons() As Boolean) As Boolean
     Return True
End Function

C#


public bool Input_Joystick(bool[] Buttons)
{
     return true;
}