⁘ ui.core

DisposableHTMLElement

Ah hah !

Yey, new shit ui.core.DisplayObject
go to → Members

Extends

  • HTMLElement

Signals

common.SIGNALRELEASING

Broadcasted right before the object is about to be released. Offers the opportunity to cancel release using `PreventRelease`.

hook( target )
# Type Description
args[0] → target ui.core.DisposableHTMLElement

Source of the signal ( would be event.target )

common.SIGNALRELEASED

Broadcasted when the object has been released.

hook( target )
# Type Description
args[0] → target ui.core.DisposableHTMLElement

Source of the signal ( would be event.target )

ui.core.UI_SIGNALFIRST_PAINT

Broadcasted once in the lifetime of the object, the first time it is painted.

hook( target )
# Type Description
args[0] → target ui.core.DisposableHTMLElement

Source of the signal ( would be event.target )

ui.core.UI_SIGNALPAINTED

Broadcasted when the object has at least one painted pixel.

hook( target )
# Type Description
args[0] → target ui.core.DisposableHTMLElement

Source of the signal ( would be event.target )

ui.core.UI_SIGNALUNPAINTED

Broadcasted when the object was painted but stopped being painted.

hook( target )
# Type Description
args[0] → target ui.core.DisposableHTMLElement

Source of the signal ( would be event.target )

Utils

Methods

protected_Bind(p_func)

Bind a function to this instance.

Parameters:
Name Type Description
p_func function
Examples:
this._Bind(this.foo);
Rendering

Members

read-onlyisPainted

TODO

staticprotected__usePaintCallback

Determine whether the object uses paint callbacks and thus broadcast paint signals.
Note : this property is set on a per-class basis, rather than on a per-instance basis. Set this value by overloading it in your class definition.

... extends DisposableHTMLElement{
 static __usePaintCallback = true;
}

Methods

protectedoverride-me_OnPaintChange()

TODO

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}

Unwatch a signal broadcasted by this object

Parameters:
Name Type Default Description
p_signal *

The signal that was being watched

p_fn function

The callback to be removed

p_listener * null

The callback's 'thisArg', if any

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

Watch a signal broadcasted by this object.
Note that while you can provide an anonymous function, you won't be able to Unwatch it.

Parameters:
Name Type Default Description
p_signal *

The signal to watch for

p_fn function

The callback to trigger when the signal fires

p_listener * null

The callback's 'thisArg', if any

Examples:
var foo = someFunction;
object.Watch(SIGNAL.RELEASED, foo);
object.Watch(SIGNAL.RELEASED, foo, this);
object.Watch(SIGNAL.RELEASED, (obj)=>{ ... }));

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

Watch a signal broadcasted by this object, once only; meaning if the signal the listener gets automatically removed right after the next signal broadcast.

Parameters:
Name Type Description
p_signalId *

The signal to watch for

p_fn function

The callback to trigger when the signal fires

p_listener *

The callback's 'thisArg', if any

protected_Broadcast(p_signal, …args)

Parameters:
Name Type Attributes Description
p_signal *
args any <repeatable>
Pooling

Group of methods related to the NKMjs pooling system.

Members

read-onlyisReleasing :boolean

Whether the object is currently in the process of being released or not.

Methods

override-me_Wake()

Wake is called when using UI' ui.core.UI.Rent when an item is rented. Since objects are pooled, this acts as a surrogate constructor. In order to take advantage of the Wake call, override _Wake.

PreventRelease()

Prevents the object from being released.

Release()

Releases the object and returns it back to the pool.

protectedoverride-me_CleanUp()

Called when the object is released. Resets most properties to their initial values.
Override this method in your own implementations to 'reset' the object to the state you want it to be when it gets rented again through common.POOL.Rent