Skip to content

Element Properties

Shane Brinkman-Davis edited this page Mar 21, 2016 · 12 revisions

This page covers the core properties for Art.Engine.Element. Other Element types may have their own custom properties.

Misc

  • key - user-settable name/key for referencing the element. Same as the key in Art.React.
  • cursor - set the mouse cursor when mouse is over the element
  • userProperties - can be set to whatever you want and read back later
  • cacheDraw - if true, attempts to keep a cache of the drawn element. Can be a significant performance enhancement if used judiciously.
  • on - event handlers map

Family

  • children
  • parent

Drawing

  • visible - boolean (default: true) If not visible, it is as-if the element doesn't exist. It isn't included in layout. It isn't drawn.
  • opacity - number between 0 and 1 (default: 1) If an element is visible and has opacity = 0, it will be included in layout, but it won't be drawn.
  • compositeMode - 'add', 'normal', 'target_alphamask', 'alphamask', 'destover', 'sourcein', 'inverse_alphamask', 'targetAlphamask', 'destOver', 'sourceIn', 'replace' or 'inverseAlphamask' (default: 'normal')
  • clip - boolean (default: false)

Events

  • pointerEventPriority - number (default: 0) When a pointer (or mouse) event happens, all elements geometrically under the event location are put in an array. The primary sort is pointerEventPriority, the secondary sort prioritizes parents over children. Every element in the list is then handed the Event. Each element can, if desired, capture the event in which case no further elements will see the event.
    • SBD NOTE 2016: This breaks the encapsulation goals of the Art.Engine. I'm looking for a better alternative.
  • receivePointerEvents - 'never', 'inLogicalArea', 'inPaddedArea', or 'passToChildren' (default: 'inLogicalArea')

Animation

  • animators (NEW)

Old, possibly going away:

  • animate
  • childAddedAnimation
  • childRemovedAnimation
  • addedAnimation
  • removedAnimation

Children Layout Properties

  • childrenLayout
  • childrenGrid
  • childrenAlignment
  • inFlow
    • set to true on child to opt-out of parent's children layout

Geometry Properties

See Element Geometry

  • size
  • location
  • margin
  • padding
  • axis
  • angle
  • scale
  • elementToParentMatrix

Read-only:

  • currentSize
  • currentLocation
  • currentPadding
  • currentMargin
  • elementToAbsMatrix
  • absToElementMatrix
  • parentToElementMatrix

Clone this wiki locally