![]() |
Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
|
#include <components.hpp>
Public Member Functions | |
| virtual | ~Component ()=default |
| virtual void | update (float deltaTime) |
| virtual void | render (std::shared_ptr< Window > window) |
| virtual void | initialize () |
| virtual void | physicsUpdate () |
| virtual void | input (InputEvent &event) |
| virtual void | postLoad () |
| virtual void | exit () |
| Node * | getNode () const |
| void | setNode (Node *n) |
| template<class Archive > | |
| void | save (Archive &ar) const |
| template<class Archive > | |
| void | load (Archive &ar) |
Base class for any component that can be attached to a Node. It exposes several virtual functiosn that are called across any components' lifetime, such as update(float deltaTime), initialize(), input(InputEvent &event), physicsUpdate(), render(std::shared_ptr<Window> window) and exit().
For serialization of any class that is based on Component, you need to implement the save() and load() methods, which are used by cereal for serialization and deserialization.
|
virtualdefault |
|
inlinevirtual |
Reimplemented in Script, AudioSource, and PhysicsBody.
| Node * Component::getNode | ( | ) | const |
|
inlinevirtual |
Reimplemented in Tilemap, Script, Sprite, AnimatedSprite, Camera, and PhysicsBody.
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Reimplemented in Script, StaticBody, RigidBody, KinematicBody, and PhysicsBody.
|
inlinevirtual |
Reimplemented in AnimatedSprite, and Sprite.
|
inlinevirtual |
Reimplemented in Script, Label, ShapeSprite, Sprite, AnimatedSprite, and Tilemap.
|
inline |
| void Component::setNode | ( | Node * | n | ) |
|
inlinevirtual |
Reimplemented in Script, AudioSource, AnimatedSprite, Camera, and Label.