-
Notifications
You must be signed in to change notification settings - Fork 0
Components
Component component = new Component(parent);
-
Component.Active(bool): Component's update and draw functions are sometimes made to stop when this variable isn't true. -
Component.Start()(function): Gets called right before being added to a GameObject. -
Component.Update(GameTime)(function): Gets called every frame. -
Component.Draw()(function): Handles rendering.
This component doesn't usually have to get added to a GameObject, as every GameObject has one built-in.
Transform transform = new Transform(GameObject parent, Vector2 position, float rotation, float scale);
-
Transform.position(Vector2): GameObject's position. -
Transform.localPosition(Vector2): The local position of the object, used to move the object when it's a child of another object. -
Transform.rotation(double): GameObject's rotation. -
Transform.scale(float): GameObject's size. 1 being 1x size, 2 being 2x size and so on.
Renderer render = new Renderer(GameObject parent);
Renderer render = new Renderer(GameObject parent, Texture2D sprite);
Renderer render = new Renderer(GameObject parent, string spritePath);
-
Renderer.sprite(Texture2D): The sprite that is rendered. -
Renderer.color(Color): The color that the sprite will be rendered in. -
Renderer.origin(Vector2): The origin point of the sprite. When the sprite gets rendered, the origin point will be exactly where the GameObject is located. -
Renderer.CalculateOrigin(Vector2 point)(function): Calculates the origin point automatically, accepts inputs from 0.0 to 1.0 to signify the position on the sprite.
Collider collider = new Collider(GameObject parent);
-
Collider.Position(Vector2D): The position used to convert the Collider into a Rectangle. -
Collider.Size(Vector2D): The size of the Collider used to convert the Collider into a Rectangle. -
Collider.CheckForCollision(Collider)(bool): Checks if the Collider is touching the passed Collider.
CharacterController controller = new CharacterController(GameObject parent);
-
CharacterController.velocity(Vector2): the direction and speed of movement.