Kiwi.HUD.HUDDisplay Class
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.GameThe game that this HUD Display belongs to.
-
name
StringThe name of this display.
Returns:
HUDDisplay
Item Index
Methods
addWidget
-
widget
Adds a widget to the HUDDisplay. Returns a boolean as an indication of whether or not it was successful.
Parameters:
-
widget
Kiwi.HUD.HUDWidgetThe widget to be added to the Display
Returns:
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:
"HUDDisplay"
removeAllWidgets
()
public
Removes all of the widgets on this display.
removeFromContainer
-
widget
Removes a widget from on the HUDDisplay.
Parameters:
-
widget
Kiwi.HUD.HUDWidgetThe Widget to be removed.
Returns:
removeWidget
-
widget
Removes a singular widget from the display. Returns a boolean as an indication of if anything happened or not.
Parameters:
-
widget
Kiwi.HUD.HUDWidgetThe widget to be removed.
Returns:
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.
_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.