Platformer
Platformer
|
A basic button component class. More...
#include <Button.hpp>
Public Member Functions | |
Button (std::function< void(GameObject &)> onClick) | |
Creates a new button that calls the given function. More... | |
virtual void | Update () |
Updates this component. | |
Public Member Functions inherited from Component | |
void | SetParentGameObject (std::weak_ptr< GameObject > g) |
Sets the given GameObject as this component's parent. More... | |
virtual void | Init () |
Initializes this component. | |
std::shared_ptr< GameObject > | GetGameObject () |
Gets a shared ptr reference to this component's GameObject. More... | |
Private Attributes | |
std::function< void(GameObject &)> | fun |
The function to be called upon click. | |
Additional Inherited Members | |
Protected Attributes inherited from Component | |
std::weak_ptr< GameObject > | gameObject |
This component's parent GameObject. | |
A basic button component class.
Button::Button | ( | std::function< void(GameObject &)> | onClick | ) |
Creates a new button that calls the given function.
onClick | Function to be called upon click |