new PatternElement(elementUseopt)
todoc
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
elementUse |
Object |
<optional> |
Extends
Members
allowDrop :Boolean
If the element allows drop on it
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
- To Do:
-
- Implement allowDrop
angle :Number
The clockwise rotation of the entry
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
background :String
The background of the element
- Inherited From:
- Type:
- String
- Default Value:
- ''
- Source:
border :String
The border of the element
- Inherited From:
- Type:
- String
- Source:
borderBottom :String
The bottom border of the element
- Inherited From:
- Type:
- String
- Source:
borderBottomColor :String
The bottom border color of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderBottomStyle :String
The bottom border style of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderBottomWidth :String|Number
The bottom border width of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
borderColor :String
The color of the element's border
- Inherited From:
- Type:
- String
- Source:
borderLeft :String
The left border of the element
- Inherited From:
- Type:
- String
- Source:
borderLeftColor :String
The left border color of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderLeftStyle :String
The left border style of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderLeftWidth :String|Number
The left border width of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
borderRight :String
The right border of the element
- Inherited From:
- Type:
- String
- Source:
borderRightColor :String
The right border color of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderRightStyle :String
The right border style of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderRightWidth :String|Number
The right border width of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
borderStyle :String
The style of the element's border
- Inherited From:
- Type:
- String
- Source:
borderTop :String
The top border of the element
- Inherited From:
- Type:
- String
- Source:
borderTopColor :String
The top border color of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderTopStyle :String
The top border style of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'none'
- Source:
borderTopWidth :String|Number
The top border width of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
borderWidth :String
The width of the element's border
- Inherited From:
- Type:
- String
- Source:
(readonly) bottom :Number
The bottom position of the element on the screen, including margin
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) className :String
The classes of the element
- Inherited From:
- Type:
- String
- Source:
cursor :String
The cursor type of the element
- Inherited From:
- Type:
- String
- Default Value:
- 'default'
- Source:
- To Do:
-
- Implement cursor
draggable :Boolean
Allows the element to be moved using the mouse
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
dragState :Boolean
The dragging status of the element
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
- To Do:
-
- Implement dragState
(readonly) elementName :String
The name of the element
- Overrides:
- Type:
- String
- Default Value:
- 'Pattern'
- Source:
(readonly) elementType :String
The type of the element
- Overrides:
- Type:
- String
- Default Value:
- 'PatternElement'
- Source:
flipX :Boolean
If the element should be mirrored horizontally
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
flipY :Boolean
If the element should be mirrored vertically
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
flow :'none'|'horizontal'|'vertical'
The flow of the element
- Inherited From:
- Type:
- 'none' | 'horizontal' | 'vertical'
- Default Value:
- 'none'
- Source:
height :Number|String
The height of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 0
- Source:
horizontalAlign :'left'|'center'|'right'
The horizontal align of the element
- Inherited From:
- Type:
- 'left' | 'center' | 'right'
- Default Value:
- 'left'
- Source:
(readonly) id :String
The id of the element
- Inherited From:
- Type:
- String
- Default Value:
- null
- Source:
(readonly) img :Image
The image of the element
isBlock :Boolean
If the element allows mouse events through transparent pixel
- Inherited From:
- Type:
- Boolean
- Default Value:
- true
- Source:
- To Do:
-
- Implement isBlock
(readonly) left :Number
The left position of the element on the screen, including margin
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
margin :String
The margin of the element
- Inherited From:
- Type:
- String
- Source:
marginBottom :String|Number
The bottom margin of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
marginLeft :String|Number
The left margin of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
marginRight :String|Number
The right margin of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
marginTop :String|Number
The top margin of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
mask :String
The mask id of the element
- Inherited From:
- Type:
- String
- Default Value:
- ''
- Source:
maxHeight :Number|String
The maximum height of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
maxWidth :Number|String
The maximum width of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
maxX :Number|String
The maximum x position of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
maxY :Number|String
The maximum y position of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
minHeight :Number|String
The minimum height of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
minWidth :Number|String
The minimum width of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
minX :Number|String
The minimum x position of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
minY :Number|String
The minimum y position of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 'none'
- Source:
offsetX :Number|String
The horizontal offset of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 0
- Source:
offsetY :Number|String
The vertical offset of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 0
- Source:
onFocus :Boolean
The focus status of the element
- Inherited From:
- Type:
- Boolean
- Default Value:
- false
- Source:
- To Do:
-
- Implement onFocus
opacity :Number
The transparency of the element
- Inherited From:
- Type:
- Number
- Default Value:
- 1
- Source:
- To Do:
-
- Implement opacity
padding :String
The padding of the element
- Inherited From:
- Type:
- String
- Source:
paddingBottom :String|Number
The bottom padding of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
paddingLeft :String|Number
The left padding of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
paddingRight :String|Number
The right padding of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
paddingTop :String|Number
The top padding of the element
- Inherited From:
- Type:
- String | Number
- Default Value:
- 0
- Source:
(readonly) parentElement :ContainerElement
The parentElement of the element
- Inherited From:
- Type:
- Default Value:
- null
- Source:
(readonly) parentLayer :Layer
The parentLayer of the element
- Inherited From:
- Type:
- Default Value:
- null
- Source:
(readonly) parentX :Number
The x position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) parentXC :Number
The horizontal center position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Source:
(readonly) parentXE :Number
The horizontal end position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Source:
(readonly) parentY :Number
The y position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) parentYC :Number
The vertical center position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Source:
(readonly) parentYE :Number
The vertical end position of the element, relative to it's parent
- Inherited From:
- Type:
- Number
- Source:
(readonly) renderHeight :Number
The layout height of the element
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) renderWidth :Number
The layout width of the element
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
repeat :String
A String indicating how to repeat the image (repeat|repeat-x|repeat-y|no-repeat)
(readonly) right :Number
The right position of the element on the screen, including margin
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
scaleX :Number
The width ratio of the element
- Inherited From:
- Type:
- Number
- Default Value:
- 1
- Source:
scaleY :Number
The height ratio of the element
- Inherited From:
- Type:
- Number
- Default Value:
- 1
- Source:
(readonly) screenX :Number
The x position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) screenXC :Number
The horizontal center position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Source:
(readonly) screenXE :Number
The horizontal end position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Source:
(readonly) screenY :Number
The y position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) screenYC :Number
The vertical center position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Source:
(readonly) screenYE :Number
The vertical end position of the element, relative to the scene
- Inherited From:
- Type:
- Number
- Source:
sourceHeight :Number|String
The height of the source image to draw into the destination context
sourceWidth :Number|String
The width of the source image to draw into the destination context
sourceX :Number|String
The x position of the source image to draw into the destination context
sourceY :Number|String
The y position of the source image to draw into the destination context
title :String
The title of the element
- Inherited From:
- Type:
- String
- Default Value:
- ''
- Source:
- To Do:
-
- Implement title
(readonly) top :Number
The top position of the element on the screen, including margin
- Inherited From:
- Type:
- Number
- Default Value:
- 0
- Source:
(readonly) uuid :String
The uuid of the element
- Inherited From:
- Type:
- String
- Default Value:
- null
- Source:
verticalAlign :'top'|'middle'|'bottom'
The vertical align of the element
- Inherited From:
- Type:
- 'top' | 'middle' | 'bottom'
- Default Value:
- 'top'
- Source:
vX :Number
The horizontal velocity of the element
- Inherited From:
- Type:
- Number
- Source:
vY :Number
The vertical velocity of the element
- Inherited From:
- Type:
- Number
- Source:
width :Number|String
The width of the element
- Inherited From:
- Type:
- Number | String
- Default Value:
- 0
- Source:
wrap :Boolean
The wrap of the element
- Inherited From:
- Type:
- Boolean
- Default Value:
- true
- Source:
x :Number|String
The x position of the element
y :Number|String
The y position of the element
Methods
addClass(item, orderIDopt) → {Element}
Adds a class to the element's classList
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
item |
String | ||
orderID |
int |
<optional> |
- Inherited From:
- Source:
- See:
Returns:
Elementthis
addEventListener(type, listener) → {EventTarget}
Adds a listener to the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
addProp(propertyKey, primitiveValue, inheritableopt) → {Element}
Adds a property to the Element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertyKey |
String | ||
primitiveValue |
* | ||
inheritable |
Boolean |
<optional> |
- Inherited From:
- Source:
- To Do:
-
- Need to rewrite the property handler methods
Returns:
Elementthis
addPropSafe(propertyKey, primitiveValue, inheritableopt) → {Element}
Adds a property to the Element if it doesn't has it already
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertyKey |
String | ||
primitiveValue |
* | ||
inheritable |
Boolean |
<optional> |
- Inherited From:
- Source:
Returns:
Elementthis
animate(animData, duration, delayopt) → (nullable) {Task}
If the element is in a scene, adds an animation task to the scene's queue
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
animData |
Object | ||
duration |
int | ||
delay |
int |
<optional> |
- Inherited From:
- Source:
Returns:
Taskanimation(animData, duration, delayopt) → {Task}
Creates an animation task
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
animData |
Object | ||
duration |
int | ||
delay |
int |
<optional> |
- Inherited From:
- Source:
- To Do:
-
- Handle colors and non-numeric values
Returns:
TaskapplyMask(ctx) → {Element}
Applies a mask to the rendering context
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D |
- Inherited From:
- Source:
Returns:
Elementthis
applyTransform(ctx) → {Element}
Applies transformation to the rendering context
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D |
- Inherited From:
- Source:
Returns:
Elementthis
dispatchEvent(type) → {EventTarget}
Dispatches an Event at the specified EventTarget
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
Returns:
EventTargetthis
draw(ctx) → {PatternElement}
Draws the element to the given context
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D |
Returns:
PatternElementthis
drawBox(ctx) → {Element}
Draws background and border if necessary
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D |
- Inherited From:
- Source:
- To Do:
-
- Implement lineDash
Returns:
Elementthis
eachEventListener(type, callback) → {EventTarget}
Executes a provided function once per event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
callback |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
edit(source) → {Element}
Edits the element
Parameters:
Name | Type | Description |
---|---|---|
source |
Object |
- Inherited From:
- Source:
Returns:
Elementthis
emit(type) → {EventTarget}
Dispatches an Event at the specified EventTarget
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
getProp(propertyKey) → (nullable) {ElementProperty}
Returns an ElementProperty of the Element by key
Parameters:
Name | Type | Description |
---|---|---|
propertyKey |
String |
- Inherited From:
- Source:
Returns:
ElementPropertygetProps(filteropt) → {Array}
Returns all ElementProperty from the Element (reduced by the given filter)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filter |
function |
<optional> |
- Inherited From:
- Source:
Returns:
ArraygetScene() → (nullable) {Scene}
Returns the element's scene or null
- Inherited From:
- Source:
- To Do:
-
- (?)Check Layer contains Element and Scene contains Layer
Returns:
ScenehasEventListener(type) → {Boolean}
Determines if the eventTarget has eventListeners of the given type
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
Returns:
BooleanhasProp(propertyKey) → {Boolean}
Checks if the Element has a specific property
Parameters:
Name | Type | Description |
---|---|---|
propertyKey |
String |
- Inherited From:
- Source:
Returns:
BooleanisChildOf(container) → {Boolean}
Determines if the element is child of a container
Parameters:
Name | Type | Description |
---|---|---|
container |
ContainerElement |
- Inherited From:
- Source:
Returns:
BooleanmeasureHeight() → {Number}
Gets the auto height of the element
Returns:
NumbermeasureWidth() → {Number}
Gets the auto width of the element
Returns:
Numbermousedown(callback) → {Element}
Registers a "mousedown" event listener on the element
Parameters:
Name | Type | Description |
---|---|---|
callback |
String | function |
- Inherited From:
- Source:
Returns:
Elementthis
mouseenter(callback) → {Element}
Registers a "mouseenter" event listener on the element
Parameters:
Name | Type | Description |
---|---|---|
callback |
String | function |
- Inherited From:
- Source:
Returns:
Elementthis
mouseleave(callback) → {Element}
Registers a "mouseleave" event listener on the element
Parameters:
Name | Type | Description |
---|---|---|
callback |
String | function |
- Inherited From:
- Source:
Returns:
Elementthis
mousemove(callback) → {Element}
Registers a "mousemove" event listener on the element
Parameters:
Name | Type | Description |
---|---|---|
callback |
String | function |
- Inherited From:
- Source:
Returns:
Elementthis
mouseup(callback) → {Element}
Registers a "mouseup" event listener on the element
Parameters:
Name | Type | Description |
---|---|---|
callback |
String | function |
- Inherited From:
- Source:
Returns:
Elementthis
off(type, listener) → {EventTarget}
Removes a listener from the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
offAll() → {EventTarget}
Removes all listeners
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
on(type, listener) → {EventTarget}
Adds a listener to the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
removeAllEventListeners() → {EventTarget}
Removes all listeners
- Inherited From:
- Source:
Returns:
EventTargetthis
removeClass(item) → {Element}
Removes a class from the element's classList
Parameters:
Name | Type | Description |
---|---|---|
item |
String |
- Inherited From:
- Source:
- See:
Returns:
Elementthis
removeEventListener(type, listener) → {EventTarget}
Removes a listener from the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
removeProp(propertyKey) → {Element}
Removes a property from the Element
Parameters:
Name | Type | Description |
---|---|---|
propertyKey |
String |
- Inherited From:
- Source:
Returns:
Elementthis
scale(widthRatio, heightRatio) → {Element}
Scales the element
Parameters:
Name | Type | Description |
---|---|---|
widthRatio |
int | |
heightRatio |
int |
- Inherited From:
- Source:
Returns:
Elementthis
setProp(propertyKey, primitiveValue, inheritableopt) → {Element}
Edits a property of the Element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertyKey |
String | ||
primitiveValue |
* | ||
inheritable |
Boolean |
<optional> |
- Inherited From:
- Source:
Returns:
Elementthis
toggle(propertyKey) → {Element}
Toggles a boolean property of the element
Parameters:
Name | Type | Description |
---|---|---|
propertyKey |
String |
- Inherited From:
- Source:
Returns:
Elementthis
toggleClass(item, orderIDopt) → {Element}
Toggles a class
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
item |
String | ||
orderID |
int |
<optional> |
- Inherited From:
- Source:
- See:
Returns:
Elementthis
toString() → {String}
Returns the string value of the element
- Inherited From:
- Source: