Skip to content
9miao edited this page Sep 18, 2014 · 2 revisions

CAResponder Detailed Description

Class Description

It’s the superclass of all objects displayed on screen and defines the interface of response touch event.

Base Class

CAObject

Method

Access modifier

Method name

Description

public

isFirstResponder

Caller is first responder or not

public

resignFirstResponder

Resign caller’s first responder status

public

becomeFirstResponder

Inform caller that it becomes the first responder of current window

public

nextResponder

Return object of next receiving event

public

ccTouchBegan

Call when touch is begun

public

ccTouchMoved

Call when touch is moved

public

ccTouchEnded

Call when touch is ended

public

ccTouchCancelled

Call when touch is cancelled

Method Description

bool isFirstResponder()

Return value: bool
Description: return a bool value to judge current object is first responder or not.

virtual bool resignFirstResponder()
Return value: bool
Description: resign call object’s first responder status at current window.

virtual bool becomeFirstResponder()
Return value: bool
Description: set caller as first responder and return a bool value to judge if set is successful or not. The object that was set as first responder can receive touch event of all view.

virtual CAResponder nextResponder()*
Return value: bool
Description: return object of next receiving event, and return NULL if there is no event.

virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
Return value: bool
Parameter:

Type

Parameter name

Description

CCTouch*

pTouch

Object that touch transfers

CCEvent*

pEvent

*this parameter is undetermined

virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent)
Return value: void

Type

Parameter name

Description

CCTouch*

pTouch

Object that touch transfers

CCEvent*

pEvent

*this parameter is undetermined

virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent)
Return value: void

Type

Parameter name

Description

CCTouch*

pTouch

Object that touch transfers

CCEvent*

pEvent

*this parameter is undetermined

virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent)
Return value: void

Type

Parameter name

Description

CCTouch*

pTouch

Object that touch transfers

CCEvent*

pEvent

*this parameter is undetermined

Clone this wiki locally