This document outlines all the built-in components (as well as some prefabs) that Graphgame provides.
These are some of Graphgame's main components.
Transform is an essential component, and is available on every object. It acts as a place for important variables about the object's location to be stored. Here are the variables that it stores:
Variable | Description |
---|---|
x | The x position of the object. |
y | The y position of the object. |
scale_x | The x scale of the object. |
scale_y | The y scale of the object. |
rotation | The rotation of the object (in radians). |
collision_x | The current x collision of the object. |
collision_y | The current y collision of the object. |
collision_id | The id of the object currently being collided with. |
These components allow your objects to become visible.
Renders a rectangle.
Renders a ellipse.
Special rendering effects that should be used in conjunction with an actual renderer.
Creates an outline around a square/rectangle. The first argument is a block containing display properties for the outline, and the second is the thickness of the outline.
DOA (Dynamic Object Allocation) is a system that helps with the creation of platformer games. It dynamically allocates objects from an object pool once they come into view of the window, so that in a large world, only a few objects really exist.
It also makes the rendering of the game easier to manage by handling the viewport for you.
The main DOA behavior. This is an object that will be dynamically allocated. The first argument is the layer that the DOA is on (WIP, put 0).
Mount points are points in that the DOAs will mount to, once the mount points are visible by the window. Mount points have an x and y position, as well as a scale_x and scale_y, which the DOAs will use. The first argument is the layer that the DOA is on (WIP, put 0), and the next (which are optional) are x, y, scale_x, and scale_y.
The window is the user's screen, and should be locked to the player.
The window follower is a behavior that makes the object follow the window. That means that when the window is moved so that it is viewing the object, that object will be moved into view. This behavior should be on any objects that also have DOAs on them.
Point is a utility that adds a point to the object, which is movable by the user. This allows them to change the object's coordinates.