ViewportTransform class

Implementers

Constructors

ViewportTransform(Vector2 e, Vector2 c, double scale)

Properties

center Vector2
center of the viewport.
read / write
extents Vector2
This is the half-width and half-height. This should be the actual half-width and half-height, not anything transformed or scaled.
read / write
scale double
Returns the scaling factor used in converting from world sizes to rendering sizes.
read / write
translation Vector2
The current translation is the difference in canvas units between the actual center of the canvas and the currently specified center. For example, if the actual canvas center is (5, 5) but the current center is (6, 6), the translation is (1, 1).
read / write
yFlip bool
if we flip the y axis when transforming.
read / write
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

Methods

getScreenToWorld(Vector2 argScreen, Vector2 argWorld) → void
Takes the screen coordinates (argScreen) and puts the corresponding world coordinates in argWorld. It should be safe to give the same object as both parameters.
getWorldToScreen(Vector2 argWorld, Vector2 argScreen) → void
Takes the world coordinate (argWorld) puts the corresponding screen coordinate in argScreen. It should be safe to give the same object as both parameters.
setCamera(double x, double y, double s) → void
Sets the transform's center to the given x and y coordinates, and using the given scale.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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