-
Notifications
You must be signed in to change notification settings - Fork 2
Object oriented rendering Methods
ACharLuk edited this page Jan 21, 2018
·
1 revision
-
Common methods
- render(): Renders the object on screen
- setPos(x, y): Setter for 'x' and 'y' properties, you can use
nilif you only want to change one. - setOrigin(x, y): Set the origin point for transformations.
- setRotation(angle): Rotate the object on its origin point. angle = [0-360)
- setColor(color): Setter for 'color' property.
-
Rectangle
- setSize(width, height): Setter for 'width' and 'height' properties, you can use
nilif you only want to change one. - setTexture(texture_path): Setter for 'texture' property.
- collide(other_rectangle): Return true if the two rectangles are colliding, otherwise it returns false.
- setSize(width, height): Setter for 'width' and 'height' properties, you can use
-
Ellipse
- setRadius(xradius, yradius): Setter for 'xradius' and 'yradius' properties, if you give only xradius it will change both.
- setTexture(texture_path): Setter for 'texture' property.
- dist(other_circle): Returns the distance between the centers of the circles.
- collide(other_circle): Return true if the two circles are colliding, otherwise it returns false.
-
Textbox
- setText(some_text): Setter for 'txt' property.
- setSize(text_size): Setter for 'size' property.
-
Tutorials