|
souleng
Game engine providing full Python scripting support
|
#include <Component.hpp>
Public Member Functions | |
| virtual void | Input () |
| Called once per frame to handle any new input. | |
| virtual void | Update (float deltaTime) |
| virtual void | Render () |
| void | SetGameObject (std::weak_ptr< GameObject > ent) |
| Sets the GameObject this component is attached to. | |
| std::shared_ptr< GameObject > | GetGameObject () |
| Retrieves the GameObject this component is attached to, behind a shared pointer. | |
| template<typename T > | |
| std::shared_ptr< T > | GetComponent () |
Alias for GetGameObject()->GetComponent<T>(), for easier scripting. | |
Static Public Member Functions | |
| static ComponentType | GetType () |
Returns the type of this component to make querying GetComponent easier. | |
Protected Attributes | |
| std::weak_ptr< GameObject > | mGameObject |
Logical building block of the game engine. Components are attached to GameObjects and control everything from rendering, to physics, to input response, to general game logic.
|
inlinevirtual |
Called once per frame to handle any new input.
Reimplemented in ScriptComponent, Collision2DComponent, PyScriptComponent, TextureComponent, and Transform.
|
inlinevirtual |
Called once per frame to render any necessary parts of this component to the screen
Reimplemented in ScriptComponent, TextTexture, Collision2DComponent, PyScriptComponent, TextureComponent, and Transform.
|
inlinevirtual |
Called once per frame for any timing specific logic
| deltaTime | The tick rate of the game, in seconds. Useful for things like velocity calculations |
Reimplemented in ScriptComponent, Collision2DComponent, PyScriptComponent, TextureComponent, and Transform.