Description

Properties

x

Position X relative to the parent

y

Position Y relative to the parent

scaleX

Scale in X. Value 1 equivalent to 100%

scaleY

Scale in Y. Value 1 equivalent to 100%

skewX

Shew in X.

skewY

Shew in Y.

opacity

Opacity. Value 1 equivalent to 100%

rotation

Rotation.

width

Width. Only if value has been assigned to the creation of the element

height

Height. Only if value has been assigned to the creation of the element

regX

Position X of the point of origin.

regY

Position Y of the point of origin.

propagationOpacity

If false, does not take into account the opacity of parent elements

Methods

rotateTo

A rotation element in a direction

setOriginPoint

Defining the position of the point of origin. This amounts to assign values to properties regX and regY

clone

Creating a clone element

append

inserts the specified content as the last child of each element in the Element collection

prepend

inserts the specified content as the first child of each element in the Element collection

detach

The .detach() method is the same as .remove(). This method is useful when removed elements are to be reinserted into the stage at a later time.

pack

Compress all children in an HTML5Canvas

cache

`(1.3.1)` Cache commands this element in a HTML5Canvas

uncache

`(1.3.1)` Uncache commands this element. You must use the `cache()` method before

unpack

Decompress a compressed element with `pack` method

forceEvent

`(>= 1.3.0)` Force applying an event on the element even if it is invisible. Assign the height and width In the case of an image, when the user clicks, the event will be triggered if he clicks on an opaque area of ​​the image. By cons, if you use the forceEvent() method, the entire area of the element that will be sensitive to click. The interest is to provide a larger area to click (useful for touch devices) or give clickable transparent areas

zIndex

Change or get the index of the item. The index used to define the superposition. By default, the first element has index 0. If an item is created at the same level, it will overlay the previous element and its index will be 1. First, assign the element to a parent before using the method

zIndexBefore

Place this element before another element

remove

Removes element in stage

emtpy

Removes the element's children

attr

Get the value of an attribute for the element

removeAttr

Removes an attribute

offset

Relative positions of the parent. Returns an object with `left` and `top` properties

position

Absolute positions. Returns an object with `left` and `top` properties

scaleTo

Resizes the width and height. Equivalent to scaleX=val and scaleY=val

hide

hide element and refresh the stage

show

hide element and refresh the stage

toggle

Hide the element if visible or shown if hidden

Discussion