Here is my code where I exactly should add this code ?
[lua]module(…, package.seeall)
local ui = require(“ui”)
function new()
local localGroup = display.newGroup()
local beepsound = media.newEventSound( “1.mp3” )
local button1Release = function( event )
media.playEventSound( beepsound )
display.remove( allthemgraphics ); allthemgraphics = nil
end
local beepsound = media.newEventSound( “2.mp3” )
local button2Release = function( event )
media.playEventSound( beepsound )
display.remove( allthemgraphics ); allthemgraphics = nil
end
local beepsound = media.newEventSound( “3.mp3” )
local button3Release = function( event )
media.playEventSound( beepsound )
display.remove( allthemgraphics ); allthemgraphics = nil
end
local beepsound = media.newEventSound( “4.mp3” )
local button4Release = function( event )
media.playEventSound( beepsound )
display.remove( allthemgraphics ); allthemgraphics = nil
end
local background = display.newImage (“background2.png”)
localGroup:insert(background)
–> Set the background
– 1 –
local button1 = ui.newButton{
default = “button.png”,
over = “buttonover.png”,
onRelease = button11Release,
onEvent = buttonHandler,
id = “button1”,
text = “11”,
font = “Trebuchet-BoldItalic”,
textColor = { 51, 51, 51, 255 },
size = 13,
emboss = false
}
button1.x = 82; button1.y = 48
localGroup:insert(button1)
– 2 –
local button2 = ui.newButton{
default = “button.png”,
over = “buttonover.png”,
onRelease = button2Release,
onEvent = buttonHandler,
id = “button2”,
text = “2”,
font = “Trebuchet-BoldItalic”,
textColor = { 51, 51, 51, 255 },
size = 13,
emboss = false
}
button2.x = 238; button2.y = 48
localGroup:insert(button2)
– 3 –
local button3 = ui.newButton{
default = “button.png”,
over = “buttonover.png”,
onRelease = button3Release,
onEvent = buttonHandler,
id = “button3”,
text = “3”,
font = “Trebuchet-BoldItalic”,
textColor = { 51, 51, 51, 255 },
size = 9,
emboss = false
}
button3.x = 82; button3.y = 92
localGroup:insert(button3)
– 4 –
local button4 = ui.newButton{
default = “button.png”,
over = “buttonover.png”,
onRelease = button4Release,
onEvent = buttonHandler,
id = “button4”,
text = “4”,
font = “Trebuchet-BoldItalic”,
textColor = { 51, 51, 51, 255 },
size = 8,
emboss = false
}
button4.x = 238; button22.y = 4
localGroup:insert(button22)
return localGroup
end[/lua]
Thanks Danny [import]uid: 22037 topic_id: 17649 reply_id: 67523[/import]