API Docs for: 1.4.0
Show:

Kiwi.HUD.HUDComponents.WidgetInput Class

Extends Kiwi.Component
Module: HUDComponents
Parent Module: HUD

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
)
Kiwi.HUD.HUDComponents.WidgetInput

Parameters:

  • owner Any

    The object that this WidgetInput belongs to.

  • container HTMLElement

    The HTMLElement that the events will occur on/to.

Methods

_addEvents

() private

Creates new bindings and adds the events to the HTMLElement.

_down

(
  • evt
)
private

The method that is called when a mousedown event fires. The onDown Signal is called.

Parameters:

  • evt MouseEvent

_out

(
  • evt
)
private

The method that is called when a mouseout event fires. The onOut Signal is called.

Parameters:

  • evt MouseEvent

_over

(
  • evt
)
private

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
)
private

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

Inherited from Kiwi.Component but overwritten in src\hud\components\WidgetInput.ts:37

The type of object that this is.

Returns:

String:

'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
)
public

Changes the HTMLElement that the events are occuring on to one passed. Removes all of the current events from container before changing.

Parameters:

  • container HTMLElement

    The 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

game

Kiwi.Game public

The game this Component belongs to

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

state

Kiwi.State public

Inherited from Kiwi.Component: src\core\Component.ts:56

Available since 1.3.1

The state which this component's owner belongs to.