GA::kit v0.3
G&A's in-house C++ application framework
Loading...
Searching...
No Matches
ga::TouchZone Class Reference

#include <touchzone_component.h>

Inheritance diagram for ga::TouchZone:
ga::Component

Classes

struct  Event
 

Public Types

enum class  State { DISABLED = -1 , INACTIVE = 0 , ACTIVE = 1 }
 

Public Member Functions

void handleTouchEvent (ga::TouchEvent &touchEvt)
 
void setState (State state)
 
State getState () const
 
void enable ()
 
void disable ()
 
void setAllowLosingFocus (bool isAllowed=true)
 
void setEnableCapturingTouch (bool isEnabled=true)
 
bool getIsCapturingTouch ()
 
void invertBounds (bool invert=true)
 
bool getAreBoundsInverted () const
 
void setCustomBoundsTest (std::function< bool(TouchZone::Event)> testFn)
 
void setUseDefaultBoundsTest ()
 
bool getIsUsingCustomBoundsTest () const
 
void connectTouch (std::shared_ptr< Scene > scene, int groupId)
 
void disconnectTouch ()
 
- Public Member Functions inherited from ga::Component
 Component ()=default
 
virtual ~Component ()=default
 
 Component (const Component &other)
 
Componentoperator= (const Component &other)
 
std::shared_ptr< NodegetNode () const
 

Public Attributes

ga::Signal< TouchZone::Event & > onTouchEvent
 

Protected Member Functions

virtual void setScene (std::shared_ptr< Scene > scene)
 
- Protected Member Functions inherited from ga::Component
virtual void update ()
 
virtual void draw ()
 
virtual void setNode (std::shared_ptr< Node > node)
 
virtual void setScene (std::shared_ptr< Scene > scene)
 

Protected Attributes

State m_state
 
ga::Connection m_touchConnection
 
bool m_boundsInverted = false
 
bool m_isCapturingTouch = true
 
bool m_allowLosingFocus = false
 
std::function< bool(TouchZone::Event)> m_customBoundsTest = nullptr
 
- Protected Attributes inherited from ga::Component
std::weak_ptr< Nodem_node
 

Member Enumeration Documentation

◆ State

enum class ga::TouchZone::State
strong
Enumerator
DISABLED 
INACTIVE 
ACTIVE 

Member Function Documentation

◆ connectTouch()

void ga::TouchZone::connectTouch ( std::shared_ptr< Scene scene,
int  groupId 
)
inline

◆ disable()

void ga::TouchZone::disable ( )
inline

◆ disconnectTouch()

void ga::TouchZone::disconnectTouch ( )
inline

◆ enable()

void ga::TouchZone::enable ( )
inline

◆ getAreBoundsInverted()

bool ga::TouchZone::getAreBoundsInverted ( ) const
inline

◆ getIsCapturingTouch()

bool ga::TouchZone::getIsCapturingTouch ( )
inline

◆ getIsUsingCustomBoundsTest()

bool ga::TouchZone::getIsUsingCustomBoundsTest ( ) const
inline

◆ getState()

State ga::TouchZone::getState ( ) const
inline

◆ handleTouchEvent()

void ga::TouchZone::handleTouchEvent ( ga::TouchEvent touchEvt)
inline

◆ invertBounds()

void ga::TouchZone::invertBounds ( bool  invert = true)
inline

◆ setAllowLosingFocus()

void ga::TouchZone::setAllowLosingFocus ( bool  isAllowed = true)
inline

◆ setCustomBoundsTest()

void ga::TouchZone::setCustomBoundsTest ( std::function< bool(TouchZone::Event)>  testFn)
inline

◆ setEnableCapturingTouch()

void ga::TouchZone::setEnableCapturingTouch ( bool  isEnabled = true)
inline

◆ setScene()

virtual void ga::TouchZone::setScene ( std::shared_ptr< Scene scene)
inlineprotectedvirtual

Reimplemented from ga::Component.

◆ setState()

void ga::TouchZone::setState ( State  state)
inline

◆ setUseDefaultBoundsTest()

void ga::TouchZone::setUseDefaultBoundsTest ( )
inline

Member Data Documentation

◆ m_allowLosingFocus

bool ga::TouchZone::m_allowLosingFocus = false
protected

◆ m_boundsInverted

bool ga::TouchZone::m_boundsInverted = false
protected

◆ m_customBoundsTest

std::function<bool( TouchZone::Event )> ga::TouchZone::m_customBoundsTest = nullptr
protected

◆ m_isCapturingTouch

bool ga::TouchZone::m_isCapturingTouch = true
protected

◆ m_state

State ga::TouchZone::m_state
protected

◆ m_touchConnection

ga::Connection ga::TouchZone::m_touchConnection
protected

◆ onTouchEvent

ga::Signal<TouchZone::Event&> ga::TouchZone::onTouchEvent

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