在cocos2d-x 2.x中,存在一个名为Integer的类,我们可以使用Integer:: create (n)来创建一个Integer实例,它是一种对象。然而,自从coco2d-x 3.0测试版以来,Integer类已经被弃用了,有什么新的方法来包装它吗?
发布于 2014-03-20 14:42:26
最后我使用了intptr_t类型,它是一个与指针大小相同的整数类型
从intptr_t转换为cocos2d::对象指针:
auto obj = reinterpret_cast<cocos2d::Object *>(n);从背面看:
auto n = reinterpret_cast<intptr_t>(obj);https://stackoverflow.com/questions/22522940
复制相似问题