【发布时间】:2017-08-15 11:34:43
【问题描述】:
我要定义一个lua表,继承c++类cc.Node,并覆盖getContentSize()函数,返回一个新的contentsize。
-- here, how to inheritance cc.Node
local Ball = class('Ball')
function Ball:ctor()
end
function Ball:getContentSize()
local width -- here, how to call super getContentSize
local height
return cc.size(width + 10, height + 10)
end
return Ball
【问题讨论】: