重写了下Label,但是对Lua语法不太懂,还请高手来帮忙看看
local MyLabel = class("MyLabel",function( strMapFile )
return self:createNumber(strMapFile)
end)
function MyLabel:createNumber( strMapFile )
local texture = cc.Director:getInstance():getTextureCache():addImage(strMapFile)
local tileWidth = texture:getPixelsWide() / 10
local label = cc.Label:createWithCharMap(texture,tileWidth,texture:getPixelsHigh(),'0')
if label then
return label
end
end
function MyLabel:setNumber( n, showBit )
end
return MyLabel