Component that represents an axis of input. Interprets both X and Y from -1 to 1. Can use multiple sources of input like keyboard, mouse buttons, or joystick axes and buttons. Input can also be delivered from code.
More...
Inherits Otter.Component.
|
| Axis () |
| Create a new Axis. More...
|
|
| Axis (Key up, Key right, Key down, Key left) |
| Create a new Axis using Keys. More...
|
|
| Axis (JoyAxis x, JoyAxis y, params int[] joystick) |
| Create a new Axis using a joystick axis. More...
|
|
| Axis (AxisButton up, AxisButton right, AxisButton down, AxisButton left, params int[] joystick) |
| Create a new Axis using AxisButtons. More...
|
|
void | Reset () |
| Reset the Axis to report no input. More...
|
|
void | Clear () |
| Clear all registered inputs for the Axis. More...
|
|
Axis | AddJoyAxis (JoyAxis x, JoyAxis y, params int[] joystick) |
| Add a joystick axis. More...
|
|
Axis | AddAxis (Axis source) |
| Add another Axis to this Axis. More...
|
|
Axis | AddButton (int button, Direction direction, params int[] joystick) |
| Add a joystick button. More...
|
|
Axis | AddButton (AxisButton button, Direction direction, params int[] joystick) |
| Add a joystick axis button. More...
|
|
Axis | AddKey (Key key, Direction direction) |
| Add a key. More...
|
|
Axis | AddKeys (params Key[] upRightDownLeft) |
| Add keys. More...
|
|
void | ForceState (float x, float y) |
| Force the axis state. More...
|
|
void | ForceState (Vector2 xy) |
| Force the axis state. More...
|
|
void | ForceStateX (float x) |
| Force the axis x state. More...
|
|
void | ForceStateY (float y) |
| Force the axis y state. More...
|
|
void | ReleaseState () |
| Relinquish control of the axis back to input. More...
|
|
override void | UpdateFirst () |
| Update the Axis. More...
|
|
override string | ToString () |
|
T | GetEntity< T > () |
| Get the Entity as a specific Type. More...
|
|
virtual void | Added () |
| Called when the Component is added to the Entity. More...
|
|
virtual void | Removed () |
| Called when the Component is removed from the Entity. More...
|
|
void | RemoveSelf () |
| Removes the Component from its parent Entity. More...
|
|
virtual void | Update () |
| Called during the Update on the parent Entity. More...
|
|
virtual void | Render () |
| Called during the Render on the parent Entity. More...
|
|
virtual void | UpdateLast () |
| Called during the UpdateLast on the parent Entity. More...
|
|
T | GetComponent< T > () |
| Gets the first Component of type T from this Component's Entity. More...
|
|
List< T > | GetComponents< T > () |
| Gets a list of Components of type T from this Component's Entity. More...
|
|
|
Vector2 | Position [get] |
| The current Vector2 position of the axis. More...
|
|
float | X [get, set] |
| The X position of the axis from -1 to 1. More...
|
|
float | Y [get, set] |
| The Y position of the axis from -1 to 1. More...
|
|
float | LastX [get, set] |
| The previous X position of the axis. More...
|
|
float | LastY [get, set] |
| The previous Y position of the axis. More...
|
|
bool | ForcedInput [get, set] |
| Check if the axis is currently forced. More...
|
|
Button | Up [get, set] |
| The the up Button for the Axis. More...
|
|
Button | Left [get, set] |
| The the left Button for the Axis. More...
|
|
Button | Down [get, set] |
| Gets the down Button for the Axis. More...
|
|
Button | Right [get, set] |
| Gets the right Button for the Axis. More...
|
|
bool | HasInput [get] |
| Check if the axis has any means of input currently registered to it. More...
|
|
bool | Neutral [get] |
| Check of the axis is completely neutral. More...
|
|
int | InstanceId [get, set] |
| The Component's id for the Entity its attached to. More...
|
|
Scene | Scene [get] |
| The Scene that the parent Entity is in. More...
|
|
Collider | Collider [get] |
| The first Collider of the parent Entity. More...
|
|
Graphic | Graphic [get] |
| The first Graphic of the parent Entity. More...
|
|
List< Graphic > | Graphics [get] |
| The list of Graphics from the parent Entity. More...
|
|
List< Collider > | Colliders [get] |
| The list of Colliders from the parent Entity. More...
|
|
Component that represents an axis of input. Interprets both X and Y from -1 to 1. Can use multiple sources of input like keyboard, mouse buttons, or joystick axes and buttons. Input can also be delivered from code.
Create a new Axis using Keys.
- Parameters
-
up | The Key for Up. |
right | The Key for Right. |
down | The Key for Down. |
left | The Key for Left. |
Create a new Axis using a joystick axis.
- Parameters
-
x | The JoyAxis to use for X. |
y | The JoyAxis to use for Y. |
joystick | The joystick id to use. |
Create a new Axis using AxisButtons.
- Parameters
-
up | The AxisButton for Up. |
right | The AxisButton for Right. |
down | The AxisButton for Down. |
left | The AxisButton for Left. |
joystick | The joystick id to use. |
Add another Axis to this Axis.
- Parameters
-
source | The source Axis to use. |
- Returns
- This Axis.
Axis Otter.Axis.AddButton |
( |
int |
button, |
|
|
Direction |
direction, |
|
|
params int[] |
joystick |
|
) |
| |
Add a joystick button.
- Parameters
-
button | The joystick button id. |
direction | The direction this button should effect. |
joystick | The joystick id. |
- Returns
- The Axis.
Add a joystick axis button.
- Parameters
-
button | The joystick axis button. |
direction | The direction this axis button should effect. |
joystick | The joystick id. |
- Returns
- The Axis.
Add a joystick axis.
- Parameters
-
x | The x axis of the joystick. |
y | The y axis of the joystick. |
joystick | The joystick id. |
- Returns
- The Axis.
Add a key.
- Parameters
-
key | The keyboard key. |
direction | The direction this key should effect. |
- Returns
- The Axis.
Axis Otter.Axis.AddKeys |
( |
params Key[] |
upRightDownLeft | ) |
|
Add keys.
- Parameters
-
upRightDownLeft | Four keys to create a pair of axes from (Up, Right, Down, Left). |
- Returns
- The Axis.
void Otter.Axis.Clear |
( |
| ) |
|
Clear all registered inputs for the Axis.
static Axis Otter.Axis.CreateArrowKeys |
( |
| ) |
|
|
static |
Create a new Axis that uses the arrow keys for movement.
- Returns
- A new Axis.
static Axis Otter.Axis.CreateWASD |
( |
| ) |
|
|
static |
Create a new Axis that uses WASD for movement.
- Returns
- A new Axis.
void Otter.Axis.ForceState |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
Force the axis state.
- Parameters
-
x | The forced x state. |
y | The forced y state. |
void Otter.Axis.ForceState |
( |
Vector2 |
xy | ) |
|
Force the axis state.
- Parameters
-
xy | The forced x and y state. |
void Otter.Axis.ForceStateX |
( |
float |
x | ) |
|
Force the axis x state.
- Parameters
-
void Otter.Axis.ForceStateY |
( |
float |
y | ) |
|
Force the axis y state.
- Parameters
-
void Otter.Axis.ReleaseState |
( |
| ) |
|
Relinquish control of the axis back to input.
void Otter.Axis.Reset |
( |
| ) |
|
Reset the Axis to report no input.
override void Otter.Axis.UpdateFirst |
( |
| ) |
|
|
virtual |
float Otter.Axis.DeadZone = 0.15f |
The range that must be exceeded by joysticks in order for their input to register.
bool Otter.Axis.Enabled = true |
Determines if the axis is currently enabled. If false, X and Y will report 0.
Dictionary<Direction, List<List<int> > > Otter.Axis.JoyButtons = new Dictionary<Direction, List<List<int>>>() |
The joystick buttons to use.
bool Otter.Axis.Locked = false |
Determines if input has any effect on the axis. When set to true the axis will remain at the X and Y it was at when locked.
bool Otter.Axis.RemapRange = true |
Determines if the DeadZone will be treated as 0 for joysticks. If true, remaps the range DeadZone to 100 to 0 to 1. If false, remaps the range 0 to 100 to 0 to 1.
bool Otter.Axis.RoundInput = true |
Determines if raw data coming from the joysticks should be rounded to 2 digits.
bool Otter.Axis.ForcedInput |
|
getset |
Check if the axis is currently forced.
Check if the axis has any means of input currently registered to it.
The previous X position of the axis.
The previous Y position of the axis.
Check of the axis is completely neutral.
The current Vector2 position of the axis.
The X position of the axis from -1 to 1.
The Y position of the axis from -1 to 1.
The documentation for this class was generated from the following file: