new Projector(game, projectionRatio) → {Phaser.Plugin.Isometric.Cube}
Creates a new Isometric Projector object, which has helpers for projecting x, y and z coordinates into axonometric x and y equivalents.
Parameters:
| Name | Type | Description |
|---|---|---|
game |
Phaser.Game | The current game object. |
projectionRatio |
number | The ratio of the axonometric projection. |
- Source:
Returns:
This Cube object.
Members
-
anchor
-
- Source:
Properties:
Name Type Description anchorPhaser.Point The x and y offset multipliers as a ratio of the game world size.
-
game
-
- Source:
Properties:
Name Type Description gamePhaser.Game The current game object.
-
projectionRatio
-
- Source:
Properties:
Name Type Description projectionRationumber The ratio of the axonometric projection.
Methods
-
project(point3, out) → {Phaser.Point}
-
Use axonometric projection to transform a 3D Point3 coordinate to a 2D Point coordinate. If given the coordinates will be set into the object, otherwise a brand new Point object will be created and returned.
Parameters:
Name Type Description point3Phaser.Plugin.Isometric.Point3 The Point3 to project from.
outPhaser.Point The Point to project to.
- Source:
Returns:
The transformed Point.
- Type
- Phaser.Point
-
projectXY(point3, out) → {Phaser.Point}
-
Use axonometric projection to transform a 3D Point3 coordinate to a 2D Point coordinate, ignoring the z-axis. If given the coordinates will be set into the object, otherwise a brand new Point object will be created and returned.
Parameters:
Name Type Description point3Phaser.Plugin.Isometric.Point3 The Point3 to project from.
outPhaser.Point The Point to project to.
- Source:
Returns:
The transformed Point.
- Type
- Phaser.Point