mobile-graphic-easel-src-easeljs-display-DOMElement.js / js
<b>This class is still experimental, and more advanced use is likely to be buggy. Please report bugs.</b> 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 {{#crossLink "Container"}}{{/crossLink}} 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. <h4>Mouse Interaction</h4> DOMElement instances are not full EaselJS display objects, and do not participate in EaselJS mouse events or support methods like hitTest. To get mouse events from a DOMElement, you must instead add handlers to the htmlElement (note, this does not support EventDispatcher) var domElement = new createjs.DOMElement(htmlElement); domElement.htmlElement.onclick = function() { console.log("clicked"); } @class DOMElement @extends DisplayObject @constructor
parameter: {HTMLElement} htmlElement A reference or id for the DOM element to manage.
The DOM object to manage. @property htmlElement @type HTMLElement
@property _oldMtx @protected
@property DisplayObject_initialize @type Function @private
Initialization method. @method initialize @protected
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. @method isVisible
returns: {Boolean} Boolean indicating whether the display object would be visible if drawn to a canvas
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. @method draw
parameter: {CanvasRenderingContext2D} ctx The canvas 2D context object to draw into.
parameter: {Boolean} ignoreCache 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).
Not applicable to DOMElement. @method cache
Not applicable to DOMElement. @method uncache
Not applicable to DOMElement. @method updateCache
Not applicable to DOMElement. @method hitArea
Not applicable to DOMElement. @method localToGlobal
Not applicable to DOMElement. @method globalToLocal
Not applicable to DOMElement. @method localToLocal
DOMElement cannot be cloned. Throws an error. @method clone
Returns a string representation of this object. @method toString
returns: {String} a string representation of the instance.
Interaction events should be added to `htmlElement`, and not the DOMElement instance, since DOMElement instances are not full EaselJS display objects and do not participate in EaselJS mouse events. @event click
Interaction events should be added to `htmlElement`, and not the DOMElement instance, since DOMElement instances are not full EaselJS display objects and do not participate in EaselJS mouse events. @event dblClick
Interaction events should be added to `htmlElement`, and not the DOMElement instance, since DOMElement instances are not full EaselJS display objects and do not participate in EaselJS mouse events. @event mousedown
The HTMLElement can listen for the mouseover event, not the DOMElement instance. Since DOMElement instances are not full EaselJS display objects and do not participate in EaselJS mouse events. @event mouseover
Not applicable to DOMElement. @event tick
@property DisplayObject__tick @type Function @protected
@method _tick @protected
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.