Kiwi.HUD.HUDComponents.WidgetInput Class
The WidgetInput Component handles the input events that you may want to listen to on a widget. This Component is essentually another version of the normal Input Component but instead of for GameObjects this is for HUDWidgets.
Constructor
Kiwi.HUD.HUDComponents.WidgetInput
-
owner
-
container
Parameters:
-
owner
AnyThe object that this WidgetInput belongs to.
-
container
HTMLElementThe HTMLElement that the events will occur on/to.
Returns:
Item Index
Methods
Methods
_addEvents
()
private
Creates new bindings and adds the events to the HTMLElement.
_down
-
evt
The method that is called when a mousedown event fires. The onDown Signal is called.
Parameters:
-
evt
MouseEvent
_out
-
evt
The method that is called when a mouseout event fires. The onOut Signal is called.
Parameters:
-
evt
MouseEvent
_over
-
evt
The method that is called when a mouseover event fires. The onOver Signal is called.
Parameters:
-
evt
MouseEvent
_removeEvents
()
private
Removes the events off of the current container.
_up
-
evt
The method that is called when a mouseup event fires. The onUp Signal is called.
Parameters:
-
evt
MouseEvent
destroy
()
public
Destroys this component and all of the properties that exist on it.
objType
()
String
public
The type of object that this is.
Returns:
'WidgetInputComponent'
postUpdate
()
public
Components can postUpdate, that is run an update after the parent has updated. This is to be overriden by subclasses.
preUpdate
()
public
Components can preUpdate, that is update before the parent updates. This is to be overriden by subclasses.
setElement
-
container
Changes the HTMLElement that the events are occuring on to one passed. Removes all of the current events from container before changing.
Parameters:
-
container
HTMLElementThe new element that the events are going to occur on.
update
()
public
If the component is being added to a State rather than a Game Object then over-ride its update method to perform required tasks.
Properties
_binds
Any
private
An array of objects, that holds the events that are happening and the methods that are bound to the container.
_container
HTMLElement
private
The HTMLElement that the events are going to occur on.
active
Boolean
private
If the events are currently actively running or not.
dirty
Boolean
deprecated
public
The state of this component.
Default: false
name
String
public
The name of this component.
onDown
Kiwi.Signal
public
A Signal that dispatches events when the user presses the mouse on top of the HTMLElement.
onOut
Kiwi.Signal
public
A Signal that dispatches events when the user's mouse leaves the HTMLElement.
onOver
Kiwi.Signal
public
A Signal that dispatches events when the user's mouse initially goes over the top of the HTMLElement.
onUp
Kiwi.Signal
public
A Signal that dispatches events when the user releases the mouse on top of the HTMLElement.
owner
Object
public
The object that owns this entity