Class: Element

Element(userOptions)

new Element(userOptions)

Generic class for classes which render text or graphics in the browser

Parameters:
Name Type Description
userOptions Element.Options

User provided options

Source:

Extends

Methods

_rebuildLists()

Rebuild lists for this drawable and notify any parent drawable to do so as well. This ensures each drawable contains an updated, flat list of all the drawables beneath them. This way we save performance by not recursing through each child during draw time, and instead, drawing from the flat list at the level we care about.

Inherited From:
Source:

add(children)

Add a child drawable to this instance

Parameters:
Name Type Description
children Array.<Drawable> | Drawable

child drawables to add

Inherited From:
Source:

remove(children)

Remove a child drawable from this instance

Parameters:
Name Type Description
children Array.<Drawable> | Drawable

child drawables to remove

Inherited From:
Source:

Type Definitions

Options

Options for Element

Properties:
Name Type Description
element String | HTMLElement

Existing html element to use. If one is not provided, a div will be created by this constructor

style Object

CSS style object for the HTML element

class String

Class name which will be assigned to the element

container String | HTMLElement

Parent element which will contain the element

Source: