API Docs for: 1.4.0
Show:

Kiwi.HUD.HUDDisplay Class

Module: HUD
Parent Module: Kiwi

A HUDDisplay is a container for which you can add/removes widget on, and is more used to manage the widgets that are being displayed on it. A HUDDisplay is created through a games HUDManager and is NOT directly instantiated. Each game can contain multiple HUDDisplay's and each HUDDisplay can contain multiple HUDWidgets.

Constructor

Kiwi.HUD.HUDDisplay

(
  • game
  • name
)

Parameters:

  • game Kiwi.Game

    The game that this HUD Display belongs to.

  • name String

    The name of this display.

Returns:

HUDDisplay

Methods

addWidget

(
  • widget
)
Boolean public

Adds a widget to the HUDDisplay. Returns a boolean as an indication of whether or not it was successful.

Parameters:

Returns:

Boolean:

If it was successful or not.

hide

() public

Hides the current HUD Display from the screen.

objType

() String public

Returns the type of object that this is.

Returns:

String:

"HUDDisplay"

removeAllWidgets

() public

Removes all of the widgets on this display.

removeFromContainer

(
  • widget
)
Boolean

Removes a widget from on the HUDDisplay.

Parameters:

Returns:

Boolean:

removeWidget

(
  • widget
)
Boolean public

Removes a singular widget from the display. Returns a boolean as an indication of if anything happened or not.

Parameters:

Returns:

Boolean:

If it was successful or not.

show

() public

Shows displays the HUD Display on screen.

update

() public

Update loop.

Properties

_device

Number private

The type of device that is being targeted for the game. This is the same as games deviceTargetOption Needed as the type of device will detiremine how the items will be added to game or whether it will even work.

_game

Kiwi.Game private

The game that this HUD Display is on.

_manager

Kiwi.HUD.HUDManager private

The HUD Manager that this Display belongs to.

_widgets

Array private

Contains a list of the widgets that are contained in this HUDDisplay. Each member is of the type Kiwi.HUD.HUDWidget.

class

String public

The class name that the container element that this HUDWidget current has.

container

HTMLDivElement public

Holds the container HTMLDivElement.

name

String public

The name of this HUD Display.