Class Index | File Index

Classes


Class Shape


Extends DisplayObject.
A Shape instance encapsulates a set of vector drawing instructions so they can be rendered to the stage. All of the current drawing methods map directly to canvas 2D context APIs.
NOTE: This class is incomplete. I will be adding shortcut methods (ex. drawCircle, drawRoundRect, etc), and possibly changing the inner workings. It also doesn't clean up fill or stroke styles yet, so they can bleed into subsequent Shapes. You've been warned. :)
Defined in: Shape.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Shape(instructions)
Constructs a new Shape instance.
Field Summary
Field Attributes Field Name and Description
<private>  
 
A string containing all of the canvas drawing instructions encapsulated by this Shape.
Fields borrowed from class DisplayObject:
_activeContext, _cacheDraw, _cacheOffsetX, _cacheOffsetY, _restoreContext, _revertShadow, _revertX, _revertY, alpha, cacheCanvas, id, mouseEnabled, name, parent, regX, regY, rotation, scaleX, scaleY, shadow, visible, x, y
Method Summary
Method Attributes Method Name and Description
 
Clears all drawing instructions.
<private>  
init(instructions)
Methods borrowed from class DisplayObject:
applyShadow, cache, clone, cloneProps, draw, getStage, revertContext, toString, uncache, updateContext
Class Detail
Shape(instructions)
Constructs a new Shape instance.
Parameters:
instructions
Optional. The vector drawing instruction that this Shape will use. See the instructions property for information.
Field Detail
<private> _init

instructions
A string containing all of the canvas drawing instructions encapsulated by this Shape. These will be evaluated using a ctx variable for the current canvas 2D context. For example instructions="ctx.fillStyle='#F00';ctx.fillRect(-75,-75,150,150);" would draw a 150x150 red square. *
Method Detail
clear()
Clears all drawing instructions.

<private> init(instructions)
Parameters:
instructions

Documentation generated by JsDoc Toolkit 2.3.2 on Tue Dec 07 2010 15:40:00 GMT-0700 (MST)