-
Notifications
You must be signed in to change notification settings - Fork 4
Drawing on the screen
Drawing in pSEngine is very easy. All you need is a draw(drawer) function in your object's class, which is automatically called by the engine. The drawer parameter of the function is an object of class Drawer with several member functions that allow us to create basic geometry, handle colors and strokes, and do some more complex operations.
A basic draw() function looks like this:
draw(drawer) {
drawer
.stroke(255, 255, 255)
.line(0, 0, 40, 150);
}We will talk about the stroke(255, 255, 255) part later (but be careful not to forget it, or else you won't be able to see the line). The line(x0, y0, x1, y1) function draws a line between (x0, y0) and (x1, y1). The other functions you can use to draw basic geometry are the following:
-
ellipse(x, y, rx, ry): draws an ellipse of radiirxandrywith center(x, y).
pSEngine - Made by MecanicaScience - Official Website : https://pSEngine.mecanicascience.fr/
If you want to help on this wiki and you don't have access to it, feel free to open a new issue or comment one, while describing which page you would like to edit, and what modifications you want to do.