Cocos2d-x
4.0.0
|
Contact information. More...
Inherits EventCustom.
Public Member Functions | |
PhysicsShape * | getShapeA () const |
Get contact shape A. | |
PhysicsShape * | getShapeB () const |
Get contact shape B. | |
const PhysicsContactData * | getContactData () const |
Get contact data. | |
const PhysicsContactData * | getPreContactData () const |
Get previous contact data. | |
void * | getData () const |
Get data. | |
void | setData (void *data) |
Set data to contact. | |
EventCode | getEventCode () const |
Get the event code. | |
![]() | |
EventCustom (const std::string &eventName) | |
Constructor. | |
void | setUserData (void *data) |
Sets user data. | |
void * | getUserData () const |
Gets user data. | |
const std::string & | getEventName () const |
Gets event name. | |
![]() | |
virtual | ~Event () |
Destructor. | |
Type | getType () const |
Gets the event type. | |
void | stopPropagation () |
Stops propagation for current event. | |
bool | isStopped () const |
Checks whether the event has been stopped. | |
Node * | getCurrentTarget () |
Gets current target of the event. | |
![]() | |
void | retain () |
Retains the ownership. | |
void | release () |
Releases the ownership immediately. | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. | |
virtual | ~Ref () |
Destructor. | |
Additional Inherited Members | |
![]() | |
enum | Type |
Type Event type. More... | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
void * | _scriptObject |
scriptObject, support for swift | |
bool | _rooted |
When true, it means that the object was already rooted. | |
![]() | |
Event (Type type) | |
Constructor. | |
Contact information.
It will created automatically when two shape contact with each other. And it will destroyed automatically when two shape separated.
|
inline |
Get contact shape A.
|
inline |
Get contact shape B.
|
inline |
Get contact data.
|
inline |
Get data.
NA
|
inline |
Set data to contact.
You must manage the memory yourself, Generally you can set data at contact begin, and destroy it at contact separate.
NA