EaselJS

EaselJS  0.5.0

EaselJS > EaselJS > DOMElement
Search:
 
Filters

Class DOMElement - extends DisplayObject

This class is still experimental, and more advanced use is likely to be buggy. Please report bugs.

A DOMElement allows you to associate a HTMLElement with the display list. It will be transformed within the DOM as though it is child of the Container it is added to. However, it is not rendered to canvas, and as such will retain whatever z-index it has relative to the canvas (ie. it will be drawn in front of or behind the canvas).

The position of a DOMElement is relative to their parent node in the DOM. It is recommended that the DOM Object be added to a div that also contains the canvas so that they share the same position on the page.

DOMElement is useful for positioning HTML elements over top of canvas content, and for elements that you want to display outside the bounds of the canvas. For example, a tooltip with rich HTML content.

DOMElement instances are not full EaselJS display objects, and do not participate in EaselJS mouse events or support methods like hitTest.

Constructor

DOMElement ( htmlElement )
Parameters:
htmlElement <HTMLElement> A reference or id for the DOM element to manage.

Properties

_style - protected object


htmlElement - HTMLElement

The DOM object to manage.

Methods

cache

void cache ( )
Not applicable to DOMElement.
Returns: void

clone

DOMElement clone ( )
This presently clones the DOMElement instance, but not the associated HTMLElement.
Returns: DOMElement
a clone of the DOMElement instance.

draw

void draw ( ctx , ignoreCache )
Draws the display object into the specified context ignoring it's visible, alpha, shadow, and transform. Returns true if the draw was handled (useful for overriding functionality). NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Parameters:
ctx <CanvasRenderingContext2D> The canvas 2D context object to draw into.
ignoreCache <Boolean> Indicates whether the draw operation should ignore any current cache. For example, used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).
Returns: void

globalToLocal

void globalToLocal ( )
Not applicable to DOMElement.
Returns: void

initialize

protected void initialize ( )
Initialization method.
Returns: void

isVisible

Boolean isVisible ( )
Returns true or false indicating whether the display object would be visible if drawn to a canvas. This does not account for whether it would be visible within the boundaries of the stage. NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Returns: Boolean
Boolean indicating whether the display object would be visible if drawn to a canvas

localToGlobal

void localToGlobal ( )
Not applicable to DOMElement.
Returns: void

localToLocal

void localToLocal ( )
Not applicable to DOMElement.
Returns: void

toString

String toString ( )
Returns a string representation of this object.
Returns: String
a string representation of the instance.

uncache

void uncache ( )
Not applicable to DOMElement.
Returns: void

updateCache

void updateCache ( )
Not applicable to DOMElement.
Returns: void