[ok]Comment affiicher un texte pour quelques secondes
Publié : sam. 30/avr./2016 18:48
Bonsoir
comment faire pour que mon texte soit afficher quelques secondes sur l"écran et disparait ?
merci
comment faire pour que mon texte soit afficher quelques secondes sur l"écran et disparait ?
merci
Code : Tout sélectionner
EnableExplicit
If InitSprite()=0 Or InitKeyboard()=0 Or InitSound()=0
MessageRequester("Erreur", "Impossible d'initialiser le jeux ")
End
EndIf
;--- Les Constantes
Enumeration Windows
#Main_Window
EndEnumeration
Enumeration texte
#TexteRejouer
EndEnumeration
Global gEvent,gWidth=800,gHeight=600,gfont
gFont = LoadFont(0, "Arial", 18, #PB_Font_Bold )
;---Création de la surface du jeu
OpenWindow(#Main_Window,0,0,gWidth,gHeight,"test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Main_Window),0,0,gWidth,gHeight)
Procedure Affichetext()
CreateSprite(#TexteRejouer,90,50,#PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(#TexteRejouer))
DrawingFont(gFont)
DrawText(0,10,"TEST ",RGBA(255,255,255,255),RGBA(0,0,0,0));
StopDrawing()
EndProcedure
Affichetext()
Repeat
Repeat
gEvent=WindowEvent()
Select gEvent
Case #PB_Event_CloseWindow
End
EndSelect
Until gEvent=0
;--- Partie 2D
ClearScreen(RGB(0, 0, 0))
DisplayTransparentSprite(#TexteRejouer, 150, 10)
ExamineKeyboard()
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape)
End