0

In the current cocos2d-x 3.0rc0 distribution, the method "isEqual" doesn't seem to be available for CCNode. Using

node1->isEqual(node2)

I get an error saying "error: 'cocos2d::CCNode' has no member named 'isEqual'" )

How can I compare two nodes then?

Thanks.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
user2212461
  • 3,105
  • 8
  • 49
  • 87

1 Answers1

2

If pointer equality suffices:

if (node1 == node2) { .. }

Otherwise you'd have to implement an equality test function that does a member-by-member comparison, at least for those that you consider important for an equality test.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217