Controler Component

XBox360 and PC Compatable

The controler component is the most versitile and most used input component. It also technecly work as an output component because it can set the controlers vibration. Here is a list of the propertys, events, and methods the controler component provides;

Method Effect or Use
IsButtonPressed(Button) Returns true if the given button is currently pressed.
IsButtonJustPressed(Button) Returns true if the given button is pressed, but was not pressed one frame ago.
IsButtonJustReleased(Button) Returns true if the given button is not pressed, but was pressed one frame ago.
IsKeyPressed(Key) Returns true if the given key is pressed on the Chatpad.
IsKeyJustPressed(Keys) Returns true if the given key is pressed on the Chatpad, but it was not pressed one frame ago.
IsKeyJustReleased(Keys) Returns true if the given key is not pressed on the Chatpad, but it was pressed one frame ago.
Property Represents
IsConnected Returns true if the controler is currently connected.
Event Represents
Connected Activated when this controler is first connected or reconnected.
Disconnected Activated when this controler is first disconnected.


To create a new instance of this component, add this in your game class
public Microsoft.Xna.Extend.EZ_Controler controler;
Then inside your 'Initialise()' method, add;
controler = new Microsoft.Xna.Extend.EZ_Controler(PlayerIndex.One); 
//Change 'One' with the controler number you are trying to access.

Mouse Component

PC Compatable

The Mouse component allows easy access to input from the mouse. This object is currently incompleat and will be updated soon.

The propertys are self explanitory, (They work in similar ways as the Keyboard and controler component's methods) and you are allowed to change these propertys:
  • Position
  • PositionInWindow
  • ScrollPosition (doesnt actually move the scroll wheel, but it changes its current value to Zero for this game, will not interfear with other applications)

Keyboard Component

PC Compatable

Very simple, and compatable with both XBox360 and PCs. Methods work as described below.

Method Effect or Use
IsKeyPressed(Key) Returns true if the given key is pressed on the Chatpad.
IsKeyJustPressed(Key) Returns true if the given key is pressed on the Chatpad, but it was not pressed one frame ago.
IsKeyJustReleased(Key) Returns true if the given key is not pressed on the Chatpad, but it was pressed one frame ago.

Last edited Jun 14, 2010 at 10:37 PM by GamerMX1248, version 1

Comments

No comments yet.