Packagecitrus.input
Classpublic class InputController
InheritanceInputController Inheritance Object
Subclasses Accelerometer, AVirtualButton, AVirtualJoystick, ButtonController, Gamepad, GamePadButtonRebinder, GamePadManager, Keyboard, ScreenTouch, StickController, TimeShifter

InputController is the parent of all the controllers classes. It provides the same helper that CitrusObject class : it can be initialized with a params object, which can be created via an object parser/factory.



Public Properties
 PropertyDefined By
  defaultChannel : uint
InputController
  enabled : Boolean
InputController
  hideParamWarnings : Boolean = false
[static]
InputController
  name : String
InputController
  updateEnabled : Boolean
[read-only]
InputController
Protected Properties
 PropertyDefined By
  _ce : CitrusEngine
InputController
  _defaultChannel : uint = 0
InputController
  _enabled : Boolean = true
InputController
  _initialized : Boolean
InputController
  _input : Input
InputController
  _updateEnabled : Boolean = false
InputController
Public Methods
 MethodDefined By
  
InputController(name:String, params:Object = null)
InputController
  
destroy():void
Removes this controller from Input.
InputController
  
toString():String
InputController
  
update():void
Override this function if you need your controller to update when CitrusEngine updates the Input instance.
InputController
Protected Methods
 MethodDefined By
  
setParams(object:Object):void
InputController
  
triggerCHANGE(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction
Will register the action to the Input system as an action with an InputPhase.BEGIN phase if its not yet in the actions list, otherwise it will update the existing action's value and set its phase back to InputPhase.ON.
InputController
  
triggerOFF(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction
Will register the action to the Input system as an action with an InputPhase.END phase.
InputController
  
triggerON(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction
Will register the action to the Input system as an action with an InputPhase.BEGIN phase.
InputController
  
triggerONCE(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction
Will register the action to the Input system as an action with an InputPhase.END phase if its not yet in the actions list as well as a time to 1 (so that it will be considered as already triggered.
InputController
Property Detail
_ceproperty
protected var _ce:CitrusEngine

_defaultChannelproperty 
protected var _defaultChannel:uint = 0

_enabledproperty 
protected var _enabled:Boolean = true

_initializedproperty 
protected var _initialized:Boolean

_inputproperty 
protected var _input:Input

_updateEnabledproperty 
protected var _updateEnabled:Boolean = false

defaultChannelproperty 
defaultChannel:uint


Implementation
    public function get defaultChannel():uint
    public function set defaultChannel(value:uint):void
enabledproperty 
enabled:Boolean


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
hideParamWarningsproperty 
public static var hideParamWarnings:Boolean = false

nameproperty 
public var name:String

updateEnabledproperty 
updateEnabled:Boolean  [read-only]


Implementation
    public function get updateEnabled():Boolean
Constructor Detail
InputController()Constructor
public function InputController(name:String, params:Object = null)



Parameters
name:String
 
params:Object (default = null)
Method Detail
destroy()method
public function destroy():void

Removes this controller from Input.

setParams()method 
protected function setParams(object:Object):void

Parameters

object:Object

toString()method 
public function toString():String

Returns
String
triggerCHANGE()method 
protected function triggerCHANGE(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction

Will register the action to the Input system as an action with an InputPhase.BEGIN phase if its not yet in the actions list, otherwise it will update the existing action's value and set its phase back to InputPhase.ON.

Parameters

name:String — string that defines the action such as "jump" or "fly"
 
value:Number (default = 0) — optional value for your action.
 
message:String (default = null) — optional message for your action.
 
channel:int (default = -1) — optional channel for your action. (will be set to the defaultChannel if not set.

Returns
InputAction
triggerOFF()method 
protected function triggerOFF(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction

Will register the action to the Input system as an action with an InputPhase.END phase.

Parameters

name:String — string that defines the action such as "jump" or "fly"
 
value:Number (default = 0) — optional value for your action.
 
message:String (default = null) — optional message for your action.
 
channel:int (default = -1) — optional channel for your action. (will be set to the defaultChannel if not set.

Returns
InputAction
triggerON()method 
protected function triggerON(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction

Will register the action to the Input system as an action with an InputPhase.BEGIN phase.

Parameters

name:String — string that defines the action such as "jump" or "fly"
 
value:Number (default = 0) — optional value for your action.
 
message:String (default = null) — optional message for your action.
 
channel:int (default = -1) — optional channel for your action. (will be set to the defaultChannel if not set.

Returns
InputAction
triggerONCE()method 
protected function triggerONCE(name:String, value:Number = 0, message:String = null, channel:int = -1):InputAction

Will register the action to the Input system as an action with an InputPhase.END phase if its not yet in the actions list as well as a time to 1 (so that it will be considered as already triggered.

Parameters

name:String — string that defines the action such as "jump" or "fly"
 
value:Number (default = 0) — optional value for your action.
 
message:String (default = null) — optional message for your action.
 
channel:int (default = -1) — optional channel for your action. (will be set to the defaultChannel if not set.

Returns
InputAction
update()method 
public function update():void

Override this function if you need your controller to update when CitrusEngine updates the Input instance.