Graphics class

A vector graphics drawing surface.

Example:

// draw a red circle
var shape = Shape();
shape.graphics.circle(100, 100, 60);
shape.graphics.fillColor(Color.Red);

Note: Stroke and fill operations act on the preceding vector drawing operations.

Graphics()

Properties

bounds Rectangle<num>
hashCode int
The hash code for this object. [...]
runtimeType Type
A representation of the runtime type of the object.

Methods

arc(num x, num y, num radius, num startAngle, num endAngle, [bool antiClockwise = false])
Draw an arc at x and y.
arcElliptical(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, [bool antiClockwise = false])
Draw an arc at x and y.
arcTo(num controlX, num controlY, num endX, num endY, num radius)
From the current point in the path, draw an arc to endX and endY
beginPath
Start drawing a freeform path.
bezierCurveTo(num controlX1, num controlY1, num controlX2, num controlY2, num endX, num endY)
From the current point in the path, draw a bezier curve to endX and endY
circle(num x, num y, num radius, [bool antiClockwise = false])
Draw a circle at x and y
Clear all previously added graphics commands.
closePath
Stop drawing a freeform path.
decode(String text)
Decode the path that is encoded in the EaselJS format. Please use the decodePath method.
decodePath(String path, [PathEncoding pathEncoding = PathEncoding.SVG])
ellipse(num x, num y, num width, num height)
Draw an ellipse at x and y
fillColor(int color)
Apply a fill color to the previously drawn vector object.
Apply a fill gradient to the previously drawn vector object.
fillPattern(GraphicsPattern pattern)
Apply a fill pattern to the previously drawn vector object.
hitTest(num localX, num localY) bool
lineTo(num x, num y)
From the current point in the path, draw a line to x and y
moveTo(num x, num y)
Moves the next point in the path to x and y
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
quadraticCurveTo(num controlX, num controlY, num endX, num endY)
From the current point in the path, draw a quadratic curve to endX and endY
rect(num x, num y, num width, num height)
Draw a rectangle at x and y
rectRound(num x, num y, num width, num height, num ellipseWidth, num ellipseHeight)
Draw a rounded rectangle at x and y.
render(RenderState renderState) → void
strokeColor(int color, [num width = 1.0, JointStyle jointStyle = JointStyle.MITER, CapsStyle capsStyle = CapsStyle.NONE])
Apply a stroke color to the previously drawn vector object.
Apply a stroke color to the previously drawn vector object.
strokePattern(GraphicsPattern pattern, [num width = 1.0, JointStyle jointStyle = JointStyle.MITER, CapsStyle capsStyle = CapsStyle.NONE])
Apply a stroke pattern to the previously drawn vector object.
toString()
A string representation of this object. [...]
inherited
undoCommand() → void
Undo last graphics command

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited