IsometricProjection class
Isometric projection with a 2:1 aspect ratio.
Maps a world-space point to screen space as if the world were viewed from an isometric angle:
screenX = (worldX - worldY) * tileWidth / 2
screenY = (worldX + worldY) * tileHeight / 2
Where tileWidth : tileHeight = 2 : 1 is the "true" isometric
aspect used by nearly all iso games (Diablo, Age of Empires,
etc.).
The projection matrix bakes the iso skew plus an orthographic
clip mapping so world space feeds straight into
Canvas.drawRawAtlas.
- Inheritance
-
- Object
- Projection
- IsometricProjection
Constructors
- IsometricProjection({double viewportSize = 20, double near = -1000, double far = 1000})
- Creates an isometric projection.
Properties
- far ↔ double
-
Far clipping plane.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- near ↔ double
-
Near clipping plane.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- viewportSize ↔ double
-
Half the visible horizontal extent in world units at the
projection's neutral zoom. Larger = zoomed out.
getter/setter pair
Methods
-
matrix(
RenderSize screenSize) → Matrix4 -
Get the projection matrix for the given screen size.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visibleHeight(
RenderSize screenSize) → double -
The visible height in world units for the given screen size.
override
-
visibleWidth(
RenderSize screenSize) → double -
The visible width in world units for the given screen size.
override
-
worldToIso(
Vector2 world) → Vector2 -
Convert a world-space point directly to isometric screen-pixel
coordinates, ignoring
screenSizescaling. Useful for tests and gameplay code that speaks in "iso pixels". -
worldToScreenPoint(
Vector2 world, RenderSize screenSize) → Vector2 -
Convert a world-space point to screen-space pixels in the
screen rect described by
screenSize.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
skewMatrix(
) → Matrix4 - The isometric skew matrix.