Okay. Here’s my main.lua…
[lua]display.setStatusBar(display.DarkStatusBar)
local director = require(“director”)
local mainGroup = display.newGroup()
local function main()
mainGroup:insert(director.directorView)
W = display.contentWidth
H = display.contentHeight
director:changeScene(“Main”)
return true
end
main()[/lua]
here’s the mute button stuff…
[lua] --**MUTE BUTTON FUNCTIONS**–==================================
local mutebuttonfunction = function (event )
if event.phase == “release” then
audio.setVolume( 0, { channel=0 } )
print “Muted”
end
end
local unmutebuttonfunction = function (event )
if event.phase == “release” then
audio.setVolume( 0.1, { channel=0 } )
print “Unmuted”
end
end
–**MUTE BUTTONS**–=====================
local mutebutton = widget.newButton{
default = “soundon.png”,
over = “soundonD.png”,
width = 35,
height = 66,
onRelease = mutebuttonfunction,
}
mutebutton.isVisible = true
mutebutton.x = display.contentWidth / 12
mutebutton.y = display.contentHeight / 1.074
localGroup:insert(mutebutton.view)
local unmutebutton = widget.newButton{
default = “soundoff.png”,
over = “soundoffD.png”,
width = 35,
height = 66,
onRelease = unmutebuttonfunction,
}
unmutebutton.isVisible = false
unmutebutton.x = display.contentWidth / 12
unmutebutton.y = display.contentHeight / 1.074
localGroup:insert(unmutebutton.view)
–**MUTE BUTTON SWITCHING**–===================================
local unmutebuttonappear = function(event)
if event.phase == “ended” then
mutebutton.isVisible = false
unmutebutton.isVisible = true
end
end
mutebutton:addEventListener(“touch”, unmutebuttonappear)
local mutebuttonappear = function(event)
if event.phase == “ended” then
mutebutton.isVisible = true
unmutebutton.isVisible = false
end
end
unmutebutton:addEventListener(“touch”, mutebuttonappear)
[/lua]
This is the function for the button that switches to the setting screen I mentioned above…
[lua]–**SETTINGS BUTTON FUNCTIONS**======================
local settingsbuttonfunction = function (event )
if event.phase == “release” then
Runtime:removeEventListener( “enterFrame”, animate)
audio.stop( fannoise )
director:changeScene(“settingsmenu”, “moveFromRight”)
print “Settings menu”
end
end[/lua]
I think that’s all the stuff that matter. Let me know if it’s not. Thank you. [import]uid: 39302 topic_id: 23575 reply_id: 94616[/import]