Platformer
Platformer
include
Engine
Components
Button.hpp
1
#ifndef BUTTON_HPP
2
#define BUTTON_HPP
3
4
#include <functional>
5
6
#include "Component.hpp"
7
9
class
Button
:
public
Component
{
10
public
:
12
Button
(
13
std::function<
void
(
GameObject
&)> onClick);
14
15
virtual
void
Update
();
16
17
private
:
19
std::function<void(GameObject&)>
fun
;
20
};
21
22
#endif
Button::Update
virtual void Update()
Updates this component.
Definition:
Button.cpp:7
Button
A basic button component class.
Definition:
Button.hpp:9
Button::fun
std::function< void(GameObject &)> fun
The function to be called upon click.
Definition:
Button.hpp:19
Component
Class representing a component of a GameObject.
Definition:
Component.hpp:12
GameObject
A GameObject class.
Definition:
GameObject.hpp:14
Button::Button
Button(std::function< void(GameObject &)> onClick)
Creates a new button that calls the given function.
Definition:
Button.cpp:5
Generated on Wed Apr 18 2018 18:57:52 for Platformer by
1.8.14