Je vous l'offre de tout coeur
Code : Tout sélectionner
InitSprite()
InitKeyboard()
InitMouse()
Enumeration
#Fenetre_principale
#Canvas_principal
#Texte
#Sortie
#Aucune
EndEnumeration
Global Police = FontID(LoadFont(#PB_Any, "Arial Rounded MT", 15, #PB_Font_Bold))
Procedure VectorDrawText(X, Y, Texte$, CouleurTexte, Transparence = 255)
VectorSourceColor(RGBA(Red(CouleurTexte), Green(CouleurTexte), Blue(CouleurTexte), Transparence))
MovePathCursor(X, Y)
DrawVectorText(Texte$)
EndProcedure
Procedure VectorBox(X, Y, Largeur, Hauteur, Couleur, Transparence = 255)
VectorSourceColor(RGBA(Red(Couleur), Green(Couleur), Blue(Couleur), Transparence))
AddPathBox(X, Y, Largeur, Hauteur)
FillPath()
EndProcedure
If InitSprite() = 0
MessageRequester("ERREUR","L'initialisation à échoué",#PB_MessageRequester_Error)
EndIf
ExamineDesktops() : Global Largeur_Ecran = DesktopWidth(0) , Hauteur_Ecran = DesktopHeight(0) , Profondeur = DesktopDepth(0)
Global x,y,z,Texte.s, h_Fenetre
Largeur_Ecran-10 : Hauteur_Ecran-40
h_Fenetre = OpenWindow(#Fenetre_principale, 0, 0, Largeur_Ecran, Hauteur_Ecran, "Minimum pour un écran avec VectorDrawing", #PB_Window_ScreenCentered)
OpenWindowedScreen(h_Fenetre, 0, 0, Largeur_Ecran, Hauteur_Ecran, 0, 0, 0, #PB_Screen_SmartSynchronization)
CanvasGadget(#Canvas_principal, 0, 0, Largeur_Ecran, Hauteur_Ecran)
ShowCursor_(#True) ; montrer le curseur
StartVectorDrawing(CanvasVectorOutput(#Canvas_principal))
VectorBox(0, 0, Largeur_Ecran, Hauteur_Ecran, #Black) ;pour nettoyer l'écran
VectorFont(Police)
;- début d'affichage
;Taper ici le texte à afficher
Texte = "Pressez une touche ou cliquez pour sortir"
VectorDrawText(Largeur_Ecran/2-VectorTextWidth(Texte)/2,Hauteur_Ecran-VectorTextHeight(" "), Texte, #White)
;- fin d'affichage
StopVectorDrawing()
;- boucle d'événements
Global action.i = #Aucune
Repeat
Global Evenement = WindowEvent()
Select Evenement
Case #PB_Event_CloseWindow
action = #Sortie
Case 0
ExamineKeyboard()
If KeyboardPushed(#PB_Key_All)
action = #Sortie
EndIf
ExamineMouse()
If MouseButton(#PB_MouseButton_Left) <> 0
action = #Sortie
EndIf
If MouseButton(#PB_MouseButton_Middle) <> 0
action = #Sortie
EndIf
If MouseButton(#PB_MouseButton_Right) <> 0
action = #Sortie
EndIf
EndSelect
Until action = #Sortie
;- fermeture de l'écran & de la fenêtre
CloseScreen()
CloseWindow(#Fenetre_principale)