Figure Element base class
The set of properties and methods shared by all figure elements
A figure element has several color related properties. Color is defined as an RGBA array with values between 0 and 1. The alpha channel defines the transparency or opacity of the color where 1 is fully opaque and 0 is fully transparent.
The color property stores the element's current color, while the
defaultColor property stores the element's color when not dimmed or
dissolving. Color should only be set using the setColor method.
An element can be "dimmed" or "undimmed". For instance,
a red element might turn grey when dimmed. The property
dimColor stores the desired color to dim to and should be set with
setDimColor()
An element can be dissolved in or out with animation. Dissolving
an element out transitions its opacity from its current value to 0.
The opacity property is used when dissolving. The opacity is multiplied by
the alpha channel of color to net a final opacity. Opacity should not be
set directly as it will be overwritten by dissolve animations.
Notifications - The notification manager property notifications will
publish the following events:
beforeSetTransform: published just before the transform property is
changedsetTransform: published whenever the transform property is changedstartBeingMoved: published when the element starts being moved by touchstopBeingMoved: published when the element stops being moved by touchstartMovingFreelystopMovingFreelyshow: published when element is shownhide: published when element is hiddenvisibility: published when element element is shown or hiddenonClick: published when element is clicked oncolor: published whenever color is setbeforeDrawafterDrawsetState: state of element has been set@class
if false then element will not be processed on
next draw
transform to apply element
transform last used for drawing - includes cascade or all parent transforms
parent figure element - null if
at top level of figure
must be true to move or execute onClick
must be true to move
callback if touched or clicked
element's current color defined as red, green, blue, alpha with range 0 to 1
color to use when dimming element
color to go to when undimming element
number between 0 and 1 that is multiplied with
color alpha channel to get final opacity
movement parameters
scenario presets
current state of element
element animation manager
notification manager for element
function map for use with Recorder
put any custom state information that needs
to be captured with recorder here - only stringify-able values can go in this
object like strings, numbers, booleans and nested arrays or objects
containing these. Functions should not be put in here - use string
identifiers to fnMap if functions are needed.
Extends FigureElement
Primitive figure element
A primitive figure element is one that handles an object (drawingObject)
that draws to the screen. This object may be a GLObject, a
TextObject or a HTMLObject.
@class
Extends FigureElement
Collection figure element
A collection manages a number of children FigureElements, be they primitives or collections.
A collection's transform will be passed onto all the children elements.
@class
reference name of element