Hi, I’m trying to change the backBtn widget code with my menuBtn png code.
local function goSomewhere(event)
local goto = event.target.id
local options = {effect="crossFade", time=300}
composer.gotoScene( goto, options )
end
local function setUpDisplay(grp)
local bg = display.newRect( grp, screenLeft, screenTop, screenWidth, screenHeight )
bg.x = centerX
bg.y = centerY
bg:setFillColor(1, 0.68, 0.26)
local title = display.newText( grp, "About Scene", centerX, centerY, "Helvetica", 48 )
local backBtn = widget.newButton ({label="Back", id="menu", onRelease=goSomewhere})
backBtn.anchorX = 0
backBtn.anchorY = 1
backBtn.x = screenLeft + 10
backBtn.y = screenBottom - 10
grp:insert(backBtn)
end
-----------------------------------------------
My png code
local function setUpDisplay(grp)
local bg = display.newRect( grp, screenLeft, screenTop, screenWidth, screenHeight )
bg.x = centerX
bg.y = centerY
bg:setFillColor(1, 0.68, 0.26)
local title = display.newText( grp, "About Scene", centerX, centerY, "Helvetica", 48 )
local menuBtn = widget.newButton ({ label="MENU", id="menu", onRelease=goSomewhere })
width = 20
height = 20
defaultFile = "menuBtnDefault.png"
overFile = "menuBtnOver.png"
menuBtn.x = display.contentCenterX - 190
menuBtn.y = display.contentCenterY - 130
grp:insert(menuBtn)
--backBtn.anchorX = 0
--backBtn.anchorY = 1
--backBtn.x = screenLeft + 10
--backBtn.y = screenBottom - 10
--grp:insert(backBtn)
end
Thank you in advance