-
Notifications
You must be signed in to change notification settings - Fork 0
Graphics class
Pegacraffft edited this page Nov 3, 2020
·
2 revisions
This class is another controller class of the engine. It shouldn't be initialised. It handles stuff like rendering and the graphics loop.
This method is used to move the camera to a different location on screen. x
and y
are the top left corner of the cam.
int x:
The x position the camera should be set to.
int y:
The y position the camera should be set to.
//Moves the cam to x: 100, y: 100
Graphics.moveCam(100, 100);
Returns the camera position as a Point
.
Returns the exact center of the screen as a Point
.
This variable is the normal Graphics2D
object. It is used to render and draw graphics.
//Draws a rectangle from x: 0, y: 0 to x: 100, y: 100
Graphics.g.fillRect(0, 0, 100, 100);
This variable sets the standard width, the displays will have.
//Sets the standard width to 800px
Graphics.g.stdWidth = 800d;
This variable sets the standard height, the displays will have.
//Sets the standard height to 800px
Graphics.g.stdHeight = 800d;