CanvasDraw class
Constructors
- CanvasDraw(ViewportTransform viewport, CanvasRenderingContext2D ctx)
Properties
- ctx → CanvasRenderingContext2D
-
The canvas rendering context with which to draw.
final
- drawFlags ↔ int
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- viewport → ViewportTransform
-
finalinherited
Methods
-
appendFlags(
int flags) → void -
inherited
-
clearFlags(
int flags) → void -
inherited
-
drawCircle(
Vector2 center, num radius, Color3i color) → void -
Draw a circle.
override
-
drawCircleAxis(
Vector2 center, double radius, Vector2 axis, Color3i color) → void -
Draws a circle with an axis.
inherited
-
drawParticles(
List< Particle> particles, double radius) → void -
Draw a particle array.
override
-
drawParticlesWireframe(
List< Particle> particles, double radius) → void -
Draw a particle array.
override
-
drawPoint(
Vector2 point, num radiusOnScreen, Color3i color) → void -
Draws the given point with the given unscaled radius, in the given
color
.override -
drawPolygon(
List< Vector2> vertices, Color3i color) → void -
Draw a closed polygon provided in CCW order. WARNING: This mutates
vertices
.override -
drawSegment(
Vector2 p1, Vector2 p2, Color3i color) → void -
Draw a line segment. WARNING: This mutates
p1
andp2
.override -
drawSolidCircle(
Vector2 center, num radius, Color3i color) → void -
Draw a solid circle.
override
-
drawSolidPolygon(
List< Vector2> vertices, Color3i color) → void -
Draw a solid closed polygon provided in CCW order. WARNING: This mutates
vertices
.override -
drawString(
Vector2 pos, String s, Color3i color) → void -
inherited
-
drawStringXY(
num x, num y, String s, Color3i color) → void -
Draw a string.
override
-
drawTransform(
Transform xf, Color3i color) → void -
Draw a transform. Choose your own length scale.
override
-
flush(
) → void -
Called at the end of drawing a world.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
screenToWorld(
Vector2 argScreen) → Vector2 -
Takes the screen coordinates (argScreen) and returns the world
coordinates.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
worldToScreen(
Vector2 argWorld) → Vector2 -
Takes the world coordinate and returns the screen coordinates.
inherited
-
worldToScreenXY(
double worldX, double worldY) → Vector2 -
Takes the world coordinates and returns the screen coordinates.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited