ShapePainterRuntimeObject

ShapePainterRuntimeObject

The ShapePainterRuntimeObject allows to draw graphics shapes on screen.

Constructor

new ShapePainterRuntimeObject(runtimeScene, shapePainterObjectData)

Parameters:
Name Type Description
runtimeScene

The scene the object belongs to.

shapePainterObjectData

The initial properties of the object

Source:

Methods

clear()

Clear the graphics.

Source:

getFillOpacity()

Returns:
Type Description

an opacity value from 0 to 255.

Source:

getOutlineOpacity()

Returns:
Type Description

an opacity value from 0 to 255.

Source:

getRotationCenterX()

Returns:
Type Description

The center X relatively to the drawing origin (whereas getCenterX() is relative to the top left drawable bound and scaled).

Source:

getRotationCenterY()

Returns:
Type Description

The center Y relatively to the drawing origin (whereas getCenterY() is relative to the top left drawable bound and scaled).

Source:

getScale()

Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).

Returns:
Type Description

the scale of the object (or the geometric mean of the X and Y scale in case they are different).

Source:

getScaleX()

Get the scale of the object on X axis.

Returns:
Type Description

the scale of the object on X axis

Source:

getScaleY()

Get the scale of the object on Y axis.

Returns:
Type Description

the scale of the object on Y axis

Source:

setFillColor(rgbColor)

Parameters:
Name Type Description
rgbColor

semicolon separated decimal values

Source:

setFillOpacity(opacity)

Parameters:
Name Type Description
opacity

from 0 to 255

Source:

setHeight(newHeight)

Change the height of the object. This changes the scale on Y axis of the object.

Parameters:
Name Type Description
newHeight

The new height of the object, in pixels.

Source:

setOutlineColor(rgbColor)

Parameters:
Name Type Description
rgbColor

semicolon separated decimal values

Source:

setOutlineOpacity(opacity)

Parameters:
Name Type Description
opacity

from 0 to 255

Source:

setRotationCenter(x, y)

The center of rotation is defined relatively to the drawing origin (the object position). This avoid the center to move on the drawing when new shapes push the bounds.

When no custom center is defined, it will move to stay at the center of the drawable bounds.

Parameters:
Name Type Description
x

coordinate of the custom center

y

coordinate of the custom center

Source:

setScale(newScale)

Change the scale on X and Y axis of the object.

Parameters:
Name Type Description
newScale

The new scale (must be greater than 0).

Source:

setScaleX(newScale)

Change the scale on X axis of the object (changing its width).

Parameters:
Name Type Description
newScale

The new scale (must be greater than 0).

Source:

setScaleY(newScale)

Change the scale on Y axis of the object (changing its width).

Parameters:
Name Type Description
newScale

The new scale (must be greater than 0).

Source:

setWidth(newWidth)

Change the width of the object. This changes the scale on X axis of the object.

Parameters:
Name Type Description
newWidth

The new width of the object, in pixels.

Source: