⁘ ui.core

DisplayObjectContainer

A DisplayObjectContainer is ui.code.DisplayObject that manages an internal list of DisplayObjects childs. You can Add, Move & Remove child objects using either a string ID pointing to constructor definition in the UI, a reference to a constructor, or an instance of the latter.

go to → Members

Extends

Signals

ui.core.UI_SIGNALCHILD_ADDED

Broadcasted right after a chlid was added to the display list

hook( parent, target, index )
# Type Description
args[0] → parent ui.core.DisplayObjectContainer

Parent of the display list

args[1] → target ui.core.DisplayObject

The display object that just got added to the display list

args[2] → index number

display object index inside the display list

ui.core.UI_SIGNALCHILD_MOVED

Broadcasted right after a child was moved inside the display list

hook( parent, target, index, oldIndex )
# Type Description
args[0] → parent ui.core.DisplayObjectContainer

Parent of the display list

args[1] → target ui.core.DisplayObject

The display object that just got moved inside the display list

args[2] → index number

New index inside the display list

args[3] → oldIndex number

Old index inside the display list

ui.core.UI_SIGNALCHILD_REMOVED

Broadcasted right after a child was removed from the display list

hook( parent, target, index )
# Type Description
args[0] → parent ui.core.DisplayObjectContainer

Parent of the display list

args[1] → target ui.core.DisplayObject

The display object that just got removed to the display list

args[2] → index number

Index of the removed object (before removal)

common.SIGNALRELEASING

Inherited From:

common.SIGNALRELEASED

Inherited From:

ui.core.UI_SIGNALFIRST_PAINT

Inherited From:

ui.core.UI_SIGNALPAINTED

Inherited From:

ui.core.UI_SIGNALUNPAINTED

Inherited From:
Child Management

Members

read-onlycount :number

The number of current child in this DisplayObjectContainer

read-onlydisplayList :array

This property is exposed for iteration purposes only. If you want to add/remove/move element, do so using `Add`, `Move` and `Remove` methods.

The DisplayObjectContainer' display list.

Methods

Add(p_displayObject, p_containeropt, p_cssClassopt, p_indexopt)

TODO

Parameters:
Name Type Attributes Default Description
p_displayObject ui.core.DisplayObject
p_container * <optional>
null

parent DOM Element

p_cssClass string <optional>

css class to be added to the display object upon addition

p_index number <optional>

Index inside the display list at which the item should be inserted

Examples:
//Working with existing objects 

var myDisplayObject = ... ; // Any existing DisplayObject
var myContainer = ... ; // Any existing DisplayObjectContainer
myContainer.Add(myDisplayObject);
//Working with an existing container

var myContainer = ... ; // Any existing DisplayObjectContainer
myContainer.Add(DisplayObjectConstructor, 'css-class1 css-class2');
//Working with an existing container
//and adding the child to a specific DOM element

var myContainer = ... ; // Any existing DisplayObjectContainer
var myDomElement = ... ; // Any existing DOM Element
myContainer.Add(DisplayObjectConstructor, 'css-class1 css-class2', myDomElement);

At(p_index) → {ui.core.DisplayObject|ui.core.DisplayObject}

Return the display object at the given index.

Parameters:
Name Type Description
p_index number

Move(p_displayObject, p_index)

Move a display object inside the display list.

Parameters:
Name Type Description
p_displayObject ui.core.DisplayObject
p_index number

Remove(p_displayObject)

Remove a display object from the display list.

Parameters:
Name Type Description
p_displayObject ui.core.DisplayObject

RemoveAt(p_index) → {ui.core.DisplayObject}

Remove a display object at a specific index in the display list, and return that element.

Parameters:
Name Type Description
p_index number

Index to be removed

protectedoverride-me_OnChildAdded(p_displayObject, p_index)

Internal method called when a display object has been successfully added to the display list.
Since it is reponsible for broadcasting the CHILD_ADDED signal, overriding this methods gives you control over the order of any operations that would need to happen before or after the signal is being broadcasted.

Parameters:
Name Type Description
p_displayObject ui.core.DisplayObject
p_index number
Examples:
_OnChildAdded(p_displayObject, p_index){
    // ... Before signal broadcast
    super._OnChildAdded(p_displayObject, p_index); // Will broadcast CHILD_ADDED
    // ... After signal broadcast
}

protectedoverride-me_OnChildMoved(p_displayObject, p_index, p_oldIndex)

Internal method called when a display object has been successfully moved inside the display list.
Since it is reponsible for broadcasting the CHILD_MOVED signal, overriding this methods gives you control over the order of any operations that would need to happen before or after the signal is being broadcasted.

Parameters:
Name Type Description
p_displayObject ui.core.DisplayObject
p_index number
p_oldIndex number
Examples:
_OnChildMoved(p_displayObject, p_index, p_oldIndex){
    // ... Before signal broadcast
    super._OnChildMoved(p_displayObject, p_index, p_oldIndex); // Will broadcast CHILD_MOVED
    // ... After signal broadcast
}

protectedoverride-me_OnChildRemoved(p_displayObject, p_index)

Internal method called when a display object has been successfully removed from the display list.
Since it is reponsible for broadcasting the CHILD_REMOVED signal, overriding this methods gives you control over the order of any operations that would need to happen before or after the signal is being broadcasted.

Parameters:
Name Type Description
p_displayObject ui.core.DisplayObject
p_index number
Examples:
_OnChildRemoved(p_displayObject, p_index){
    // ... Before signal broadcast
    super._OnChildRemoved(p_displayObject, p_index); // Will broadcast CHILD_REMOVED
    // ... After signal broadcast
}
Styling

Methods

protectedoverride-me_Style()

Inherited From:
Rendering

Members

read-onlyisPainted

Inherited From:

visible :boolean

Inherited From:

staticprotected__usePaintCallback

Inherited From:

Methods

protectedoverride-me_OnPaintChange()

Inherited From:

protectedoverride-me_PostRender()

Inherited From:

protectedoverride-me_Render()

Inherited From:
Hierarchy

Members

Methods

BringToFront()

Inherited From:

protectedoverride-me_OnParentChanged(p_oldParent)

Inherited From:
Broadcasting

This section list the main methods used to watch/unwatch signals on this object. For more info on signals, see signals

Methods

Unwatch(p_signal, p_fn, p_listener) → {ui.core.DisposableHTMLElement}

Inherited From:

Watch(p_signal, p_fn, p_listener) → {ui.core.DisposableHTMLElement}

Inherited From:

WatchOnce(p_signalId, p_fn, p_listener) → {ui.core.DisposableHTMLElement}

Inherited From:

protected_Broadcast(p_signal, …args)

Inherited From:
Pooling

Group of methods related to the NKMjs pooling system.

Members

read-onlyisReleasing :boolean

Inherited From:

Methods

override-me_Wake()

Inherited From:

PreventRelease()

Inherited From:

Release()

Inherited From:

protectedoverride-me_CleanUp()

Inherited From:
Misc

Members

read-onlyflags

Inherited From:

read-onlyhost

Inherited From:

order :number

Inherited From:

read-onlywrapper

Inherited From:

Methods

protected_RegisterLocalRequestHandler(p_requestType, p_fn)

Inherited From:

protected_UnregisterLocalRequestHandler(p_requestType, p_fn)

Inherited From: