-- print ( "pas de ticket" )
local noTicket = display.newText( "Pas de ticket en cours.", CX, CY, "Dosis-Book", 20 )
+ noTicket:setFillColor( 0,0,0 )
listeTickets:insert( noTicket )
else
local function initButtons()
- local boutonRetour = display.newRect( 0, 0, 60, 40 )
- boutonRetour.alpha = .01
+ -- fonction de retour à l'accueil
+ local function onAccueil( event )
- boutonRetour.anchorX = 0
+ Runtime:dispatchEvent{ name = "MenuEvent", type = "accueilSlideRight" }
+
+ end
+ local boutonRetour = widget.newButton
+ {
+ shape = "rect",
+ width = 60,
+ height = 40,
+ font = "Dosis-Book",
+ fontSize = 14,
+ fillColor = { default = { 0, 0, 0, .1 }, over = { 0, 0, 0, .08 } },
+ label = "< Accueil",
+ labelColor = { default = { 1, 1, 1, 1 }, over = { 1, 1, 1, 1 } },
+ onRelease = onAccueil,
+ }
+ boutonRetour.alpha = 1
+ boutonRetour.anchorX = 0
boutonRetour.x = SX
boutonRetour.y = VH - boutonRetour.height/2
-
listeTickets:insert( boutonRetour )
listeTickets.boutonRetour = boutonRetour
-
- -- Action du bouton retour (vers l'accueil)
-
- function boutonRetour:touch( event )
-
- if event.phase == "began" then
-
- Runtime:dispatchEvent{ name = "MenuEvent", type = "accueilSlideRight" }
-
- end
-
- end
-
- local labelRetour = display.newText( "< Accueil", 8, SY + VH - 20, "Dosis-Book", 14 )
- labelRetour.anchorX = 0
-
- listeTickets:insert( labelRetour )
end