我从cocosstudio中 绑定了
local spRule = uiLayer:getWidgetByName("Rule")
spRule??怎么换图啊。。。
我从cocosstudio中 绑定了
local spRule = uiLayer:getWidgetByName("Rule")
spRule??怎么换图啊。。。
loadtexture()方法修改图片。
感谢版主的回答。。可是
– 绑定变量 spRule
local spRule = uiLayer:getWidgetByName(“Rule”)
if spRule ~= nil then
–do
– spRule:setPosition(CCPoint(100,100))
print(“spRule”)
spRule:loadTexture(“rule/Player_Normal0.png”)
end
会出现LUA ERROR: …17F6E84D-BB45-4516-9003-4993D63B48BA/MyLua.app/cocos.lua:61: error in function ‘loadTexture’.
你好,layer没有这个方法。
下面是拥有这个方法的类型,以及调用方法:
要调用tolua.cast(对象,类名)强转
3Q 。。问题解决
请问怎么解决的啊
版主你好,我用的mac版,loadTexture以后,图片变成了原图大小,没有根据之前custom设置的size大小,这个是不是bug?
loadTexture之后会根据新图片更新size。