Is there any way to remove a ui.Button after it has been pressed? Cant seem to find one anywhere.
My function is as follows:
local function fireObject ( event )
if (event.phase == “release”) then
audio.play( cannonFiredSound )
physics.addBody(object,“dynamic”, objectBody)
object:setLinearVelocity(cannon.rotation, -500)
end
end
local shootBtn = ui.newButton{
default = “cannonObjects/shoot.png”,
over = “cannonObjects/shootOver.png”,
onEvent = fireObject,
id = “shoot”
} [import]uid: 42126 topic_id: 8651 reply_id: 308651[/import]