cocos2d-x  3.0alpha1
 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 cocos2d::Point &touchPoint)
 Finds a widget which is selected and call it's "onTouchBegan" method. More...
 
void update (float dt)
bool onTouchBegan (cocos2d::Touch *touch)
void onTouchMoved (cocos2d::Touch *touch)
void onTouchEnd (cocos2d::Touch *touch)
void onTouchCancelled (cocos2d::Touch *touch)
void setRootWidget (UIWidget *root)
UIWidgetgetRootWidget ()
void addCheckedDoubleClickWidget (UIWidget *widget)

Protected Member Functions

bool checkTouchEvent (UIWidget *root, const cocos2d::Point &touchPoint)

Protected Attributes

cocos2d::Array_manageredWidget
cocos2d::Array_selectedWidgets
cocos2d::Point _touchBeganedPoint
cocos2d::Point _touchMovedPoint
cocos2d::Point _touchEndedPoint
cocos2d::Point _touchCanceledPoint
bool _touchDown
float _longClickTime
float _longClickRecordTime
cocos2d::Array_checkedDoubleClickWidget
UIWidget_rootWidget

Constructor & Destructor Documentation

virtual ~UIInputManager ( )
virtual

Default destructor.

Member Function Documentation

void addCheckedDoubleClickWidget ( UIWidget widget)
bool checkEventWidget ( const cocos2d::Point 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 cocos2d::Point touchPoint 
)
protected
UIWidget* getRootWidget ( )
bool onTouchBegan ( cocos2d::Touch touch)
void onTouchCancelled ( cocos2d::Touch touch)
void onTouchEnd ( cocos2d::Touch touch)
void onTouchMoved ( cocos2d::Touch 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

cocos2d::Array*
_checkedDoubleClickWidget
protected
float _longClickRecordTime
protected
float _longClickTime
protected
cocos2d::Array* _manageredWidget
protected
UIWidget* _rootWidget
protected
cocos2d::Array* _selectedWidgets
protected
cocos2d::Point _touchBeganedPoint
protected
cocos2d::Point _touchCanceledPoint
protected
bool _touchDown
protected
cocos2d::Point _touchEndedPoint
protected
cocos2d::Point _touchMovedPoint
protected

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