Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top