cocos2d-x  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
UIInputManager Class Reference

#include <UIInputManager.h>

Public Member Functions

 UIInputManager ()
virtual ~UIInputManager ()
 Default destructor. More...
 
void registWidget (UIWidget *widget)
 Regist a widget to input manager. More...
 
void removeManageredWidget (UIWidget *widget)
 Remove a registed widget from input manager. More...
 
bool checkEventWidget (const CCPoint &touchPoint)
 Finds a widget which is selected and call it's "onTouchBegan" method. More...
 
void update (float dt)
bool onTouchBegan (CCTouch *touch)
void onTouchMoved (CCTouch *touch)
void onTouchEnd (CCTouch *touch)
void onTouchCancelled (CCTouch *touch)
void setRootWidget (UIWidget *root)
UIWidgetgetRootWidget ()
void addCheckedDoubleClickWidget (UIWidget *widget)

Protected Member Functions

bool checkTouchEvent (UIWidget *root, const CCPoint &touchPoint)

Protected Attributes

CCArraym_manageredWidget
CCArraym_pSelectedWidgets
CCPoint touchBeganedPoint
CCPoint touchMovedPoint
CCPoint touchEndedPoint
CCPoint touchCanceledPoint
bool m_bTouchDown
float m_fLongClickTime
float m_fLongClickRecordTime
CCArraycheckedDoubleClickWidget
UIWidgetm_pRootWidget

Constructor & Destructor Documentation

virtual ~UIInputManager ( )
virtual

Default destructor.

Member Function Documentation

void addCheckedDoubleClickWidget ( UIWidget widget)
bool checkEventWidget ( const CCPoint touchPoint)

Finds a widget which is selected and call it's "onTouchBegan" method.

Parameters
touchpoint.
Returns
true that find a widget selected, false otherwise.
bool checkTouchEvent ( UIWidget root,
const CCPoint touchPoint 
)
protected
UIWidget* getRootWidget ( )
bool onTouchBegan ( CCTouch touch)
void onTouchCancelled ( CCTouch touch)
void onTouchEnd ( CCTouch touch)
void onTouchMoved ( CCTouch touch)
void registWidget ( UIWidget widget)

Regist a widget to input manager.

Parameters
widgetregisted widget can be touched.
void removeManageredWidget ( UIWidget widget)

Remove a registed widget from input manager.

Parameters
widgetwidget which will be removed.
void setRootWidget ( UIWidget root)
void update ( float  dt)

Member Data Documentation

CCArray* checkedDoubleClickWidget
protected
bool m_bTouchDown
protected
float m_fLongClickRecordTime
protected
float m_fLongClickTime
protected
CCArray* m_manageredWidget
protected
UIWidget* m_pRootWidget
protected
CCArray* m_pSelectedWidgets
protected
CCPoint touchBeganedPoint
protected
CCPoint touchCanceledPoint
protected
CCPoint touchEndedPoint
protected
CCPoint touchMovedPoint
protected

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