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
Creates new instance of GraphicsData
onGetLocalBounds(graphics, transform) method
Calculates trimmed local bounds.
Calculates trimmed local bounds.
lineStyle(lineWidth, color, alpha, caps, joints, miterLimit) method
Sets line style. Zero or less values of
Parameters
void
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.
Returnscolor : number — Line color.
alpha : number — Line alpha.
caps : CapsStyle — Line caps style.
joints : JointStyle — Line joints style.
miterLimit : number — Miter limit.
void
fillStyle(color, alpha) method
Sets fill style
Parameters
void
Sets fill style
Parameters
color : number — Fill color.
alpha : number — Fill alpha.
Returnsalpha : number — Fill alpha.
void
fillGradient(gradient) method
Sets fill style to gradient.
Sets fill style to gradient.
fillPattern(pattern) method
Sets fill style to pattern.
Sets fill style to pattern.
clear() method
Clears the graphics that were drawn and resets fill and line styles.
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
void
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.
Returnsy : number — The y-axis of the point.
void
lineTo(x, y) method
Draws a line between last point and given.
Parameters
void
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.
Returnsy : number — The y-axis of the point.
void
arc(x, y, radius, startAngle, endAngle, anticlockwise) method
Adds an arc to the current path.
Parameters
void
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.
Returnsy : 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.
void
circle(x, y, radius) method
Adds circle to current path.
Parameters
void
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.
Returnsy : number — The y-axis of the circle's center.
radius : number — The radius of the circle.
void
rect(x, y, width, height) method
Creates closed rectangle like path.
Parameters
void
Creates closed rectangle like path.
Parameters
x : numbery : numberwidth : numberheight : number
Returnsvoid
roundedRect(x, y, width, height, radius) method
Creates closed rounded rectangle.
Parameters
void
Creates closed rounded rectangle.
Parameters
x : numbery : numberwidth : numberheight : numberradius : number
Returnsvoid
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method
Parameters
Parameters
cp1x : numbercp1y : numbercp2x : numbercp2y : numberx : numbery : number
beginPath() method
Starts new path.
Starts new path.
closePath() method
Closes current path.
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
void
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).
Returnsvoid
stroke() method
Strokes current path with the current line style..
Strokes current path with the current line style..
fill(isNonZero) method
Fills current path with the current fill style.
Parameters
void
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".
Returnsvoid
Properties
name : string | null property
Gets/Sets the name of this GraphicsData instance. Used for searching elements.
Gets/Sets the name of this GraphicsData instance. Used for searching elements.