Class GraphicsData

Structure object for graphics. Stores parsed layered data, ready for render.
Normally you should not work with this object, and use Graphics instead.

Methods

GraphicsData() constructor
Creates new instance of GraphicsData
onGetLocalBounds(graphics, transform) method

Calculates trimmed local bounds.

Parameters
graphics : Object — Object to store bounds by reference.
transform : Matrix — Matrix to transform children nodes, for internal use.
Returns
Rectangle — Calculated local bounds.
lineStyle(lineWidth, color, alpha, caps, joints, miterLimit) method

Sets line style. Zero or less values of lineWidth are ignored.

Parameters
lineWidth : number — Line width.
color : number — Line color.
alpha : number — Line alpha.
caps : CapsStyle — Line caps style.
joints : JointStyle — Line joints style.
miterLimit : number — Miter limit.
Returns
void
fillStyle(color, alpha) method

Sets fill style

Parameters
color : number — Fill color.
alpha : number — Fill alpha.
Returns
void
fillGradient(gradient) method

Sets fill style to gradient.

Parameters
gradient : GraphicsGradient — Fill gradient.
Returns
void
fillPattern(pattern) method

Sets fill style to pattern.

Parameters
pattern : GraphicsPattern — Fill pattern.
Returns
void
clear() method
Clears the graphics that were drawn and resets fill and line styles.
moveTo(x, y) method

Moves the starting point of a path to given x and y coordinates.

Parameters
x : number — The x-axis of the point.
y : number — The y-axis of the point.
Returns
void
lineTo(x, y) method

Draws a line between last point and given.

Parameters
x : number — The x-axis of the point.
y : number — The y-axis of the point.
Returns
void
arc(x, y, radius, startAngle, endAngle, anticlockwise) method

Adds an arc to the current path.

Parameters
x : number — The x-axis of the arc's center.
y : number — The y-axis of the arc's center.
radius : number — The radius of the arc.
startAngle : number — The starting angle in radians.
endAngle : number — The ending angle in radians.
anticlockwise : boolean — If true the arc will be drawn counter-clockwise.
Returns
void
circle(x, y, radius) method

Adds circle to current path.

Parameters
x : number — The x-axis of the circle's center.
y : number — The y-axis of the circle's center.
radius : number — The radius of the circle.
Returns
void
rect(x, y, width, height) method

Creates closed rectangle like path.

Parameters
x : numbery : numberwidth : numberheight : number
Returns
void
roundedRect(x, y, width, height, radius) method

Creates closed rounded rectangle.

Parameters
x : numbery : numberwidth : numberheight : numberradius : number
Returns
void
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method


Parameters
cp1x : numbercp1y : numbercp2x : numbercp2y : numberx : numbery : number
quadraticCurveTo(cpx, cpy, x, y) method


Parameters
cpx : numbercpy : numberx : numbery : number
beginPath() method
Starts new path.
closePath() method
Closes current path.
setLineDash(segments) method

Sets the line dash pattern used when stroking lines,
using an array of values which specify alternating lengths of lines and gaps which describe the pattern.

Parameters
segments : Array.<number> — An Array of numbers which specify distances to alternately draw a line and a gap (in coordinate space units).
Returns
void
stroke() method
Strokes current path with the current line style..
fill(isNonZero) method

Fills current path with the current fill style.

Parameters
isNonZero : boolean — The algorithm by which to determine if a point is inside a path or outside a path, True is for "nonzero" and False is for "evenodd".
Returns
void

Properties

name : string | null property
Gets/Sets the name of this GraphicsData instance. Used for searching elements.