libsuit  0.1.1
SFML User Interface Toolkit
Public Member Functions | List of all members
ui::Control Class Referenceabstract

A physical control. More...

#include <ui/Control.h>

Inheritance diagram for ui::Control:
Inheritance graph
[legend]

Public Member Functions

 Control (std::string name, std::string controller_name)
 Construct a control with a name and its controller name. More...
 
virtual ~Control ()
 Destroy the control. More...
 
bool isActive ()
 Tell whether the control is active. More...
 
void setActive (bool active=true)
 Change the active state of the control. More...
 
void reset ()
 Desactivate the control. More...
 
virtual void update (const sf::Event &event)=0
 Update the state of the control thanks to an event. More...
 

Detailed Description

A physical control.

Constructor & Destructor Documentation

ui::Control::Control ( std::string  name,
std::string  controller_name 
)
inline

Construct a control with a name and its controller name.

Parameters
namethe name of the control.
controller_namethe name of the controller
virtual ui::Control::~Control ( )
virtual

Destroy the control.

Member Function Documentation

bool ui::Control::isActive ( )
inline

Tell whether the control is active.

Returns
true if the control is active.
See also
Action::isActive()
void ui::Control::reset ( )
inline

Desactivate the control.

This call is equivalent to:

setActive(false);
See also
Action::reset()
void ui::Control::setActive ( bool  active = true)
inline

Change the active state of the control.

Parameters
activethe new state of the control.
virtual void ui::Control::update ( const sf::Event &  event)
pure virtual

Update the state of the control thanks to an event.

Parameters
eventthe event to update the control.
See also
Action::update()

Implemented in ui::CloseControl, ui::MouseButtonControl, ui::KeyControl, ui::GamepadButtonControl, and ui::GamepadAxisControl.