MathFunctions
Introduction
The MathFunctions class provides helper methods for performing common game math.
World and Screen Coordinates
World to Pixel
The following code returns the screen pixel coordinates of a PositionedObject. Remember, by by default in world coordinates:
Positive X points to the right
Positive Y points up
In pixel coordinates
Positive X points to the right
Positive Y points down (only when dealing with screen pixels)
Add the following using statements
Assuming myObject is a valid PositionedObject
Pixel to World
Last updated