Lua强制类型转换函数

  • Post author:
  • Post category:其他


Lua中强转一个类型函数如下:



tolua.cast(object,”CCSprite”)



第一个参数是需要强转的对象  ,  第二个参数是强转的目标类型

例如我们将x 强转 CCSprite,则: tolua.cast(x,”CCSprite”)

附源地址:http://www.himigame.com/iphone-cocos2dx/1289.html