I’m wanting it so that when I click a button It will have a popup at the bottom of the screen showing upgrade button. And if you tap the button again it will remove upgrade option. Right now I have
function cartTap( event ) if data.cartOpen == 0 then display.newImageRect( "upgrade.png", display.contentWidth, display.contentHeight ); data.cartOpen = data.cartOpen + 1 print("cartOpen = " .. data.cartOpen) end if data.cartOpen == 1 then display.remove( "upgrade.png"); data.cartOpen = data.cartOpen - 1 print("cartOpen = " .. data.cartOpen) end print("Open Cart Options") end
Right now it shows the upgrade option but if I press the button again it doesnt remove it and it adds the image again. In the console if I press it once it says
cartOpen = 0
cartOpen = 1
Open Cart Options
If I press the button again it just repeats that.