EaselJS

EaselJS  0.4.2

EaselJS > EaselJS > Shape
Search:
 
Filters

Class Shape - extends DisplayObject

A Shape allows you to display vector art in the display list. It composites a Graphics instance which exposes all of the vector drawing methods. The Graphics instance can be shared between multiple Shape instances to display the same vector graphics with different positions or transforms. If the vector art will not change between draws, you may want to use the cache() method to reduce the rendering cost.

Properties

graphics - Graphics

The graphics instance to display.

Methods

clone

void clone ( recursive )
Returns a clone of this Shape. Some properties that are specific to this instance's current context are reverted to their defaults (for example .parent).
Parameters:
recursive <Boolean> If true, this Shape's Graphics instance will also be cloned. If false, the Graphics instance will be shared with the new Shape.
Returns: void

draw

void draw ( ctx , ignoreCache )
Draws the Shape 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

initialize param {Graphics} graphics

protected void initialize param {Graphics} graphics ( )
Initialization method.
Returns: void

isVisible

Boolean isVisible ( )
Returns true or false indicating whether the Shape 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 Shape would be visible if drawn to a canvas

toString

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