local button=cc.ui.UIPushButton.new(“a.png”)
:pos(display.cx,display.cy)
:addTo(self)
我想设置button的背景,我查看api说是使用:loadTextures()这个函数
我是这样使用的
local button=cc.ui.UIPushButton.new(“a.png”)
:pos(display.cx,display.cy)
:addTo(self)
button:loadTextures(“b.png”)
但是提示错误
attempt to call method ‘loadTextures’ (a nil value)
请问应该如何设置按钮背景呢?