Platformer
Platformer
Public Member Functions | Private Attributes | List of all members
Button Class Reference

A basic button component class. More...

#include <Button.hpp>

Inheritance diagram for Button:
Inheritance graph
Collaboration diagram for Button:
Collaboration graph

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< GameObjectGetGameObject ()
 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< GameObjectgameObject
 This component's parent GameObject.
 

Detailed Description

A basic button component class.

Constructor & Destructor Documentation

◆ Button()

Button::Button ( std::function< void(GameObject &)>  onClick)

Creates a new button that calls the given function.

Parameters
onClickFunction to be called upon click

The documentation for this class was generated from the following files: