CanvasDraw class

Inheritance

Constructors

CanvasDraw(ViewportTransform viewport, CanvasRenderingContext2D ctx)

Properties

ctx CanvasRenderingContext2D
The canvas rendering context with which to draw.
final
drawFlags int
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
viewportTransform ViewportTransform
read / write, inherited

Methods

drawCircle(Vector2 center, num radius, Color3i color, [ Vector2 axis ]) → void
Draw a circle. WARNING: This mutates center.
override
drawParticles(List<Vector2> centers, double radius, List<ParticleColor> colors, int count) → void
Draw a particle array [...]
override
drawParticlesWireframe(List<Vector2> centers, double radius, List<ParticleColor> colors, int count) → 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. WARNING: This mutates point.
override
drawPolygon(List<Vector2> vertices, int vertexCount, 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 and p2.
override
drawSolidCircle(Vector2 center, num radius, Vector2 axis, Color3i color) → void
Draw a solid circle. WARNING: This mutates center.
override
drawSolidPolygon(List<Vector2> vertices, int vertexCount, Color3i color) → void
Draw a solid closed polygon provided in CCW order. WARNING: This mutates vertices.
override
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. WARNING: This mutates xf.position.
override
appendFlags(int flags) → void
inherited
clearFlags(int flags) → void
inherited
drawCircleAxis(Vector2 center, double radius, Vector2 axis, Color3i color) → void
Draws a circle with an axis
inherited
drawString(Vector2 pos, String s, Color3i color) → void
inherited
flush() → void
Called at the end of drawing a world
inherited
getScreenToWorld(Vector2 argScreen) Vector2
takes the screen coordinates (argScreen) and returns the world coordinates [...]
inherited
getScreenToWorldToOut(Vector2 argScreen, Vector2 argWorld) → void
@param argScreen @param argWorld
inherited
getScreenToWorldToOutXY(double screenX, double screenY, Vector2 argWorld) → void
takes the screen coordinates and puts the corresponding world coordinates in argWorld. [...]
inherited
getScreenToWorldXY(double screenX, double screenY) Vector2
takes the screen coordinates and returns the world coordinates. [...]
inherited
getViewportTranform() ViewportTransform
inherited
getWorldToScreen(Vector2 argWorld) Vector2
takes the world coordinate (argWorld) and returns the screen coordinates. [...]
inherited
getWorldToScreenToOut(Vector2 argWorld, Vector2 argScreen) → void
@param argWorld @param argScreen
inherited
getWorldToScreenToOutXY(double worldX, double worldY, Vector2 argScreen) → void
Takes the world coordinates and puts the corresponding screen coordinates in argScreen. [...]
inherited
getWorldToScreenXY(double worldX, double worldY) Vector2
Takes the world coordinates and returns the screen coordinates. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setCamera(double x, double y, double scale) → void
@param x @param y @param scale @deprecated use the viewport transform in {@link #getViewportTranform()}
inherited
setViewportTransform(ViewportTransform viewportTransform) → void
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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