bjr à tous
merci kcc, bel exemple
pour compléter on peut aussi aller voir dans la doc les fonctions :
DrawText(X, Y, Texte$ [, CouleurTexte [, CouleurFond]])
StringGadget(#Gadget, X, Y, Largeur, Hauteur, Texte$ [, Options])
cordialement
Code:
If OpenWindow(0, 0, 0, 200, 200, "DrawText Exemple", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateImage(0, 200, 200) And StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, 200, 200, RGB(255, 255, 255))
For i = 1 To 30
DrawText(Random(200), Random(200), "Hello World!", RGB(Random(255), Random(255), Random(255)))
Next i
StopDrawing()
ImageGadget(0, 0, 0, 200, 200, ImageID(0))
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Code:
; Démonstration des options possibles pour le gadget de saisie de texte...
If OpenWindow(0, 0, 0, 322, 205, "Les options de StringGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0, 8, 10, 306, 20, "Gadget saisie de texte normal...")
StringGadget(1, 8, 35, 306, 20, "1234567", #PB_String_Numeric)
StringGadget(2, 8, 60, 306, 20, "Gadget saisie de texte en lecture seule", #PB_String_ReadOnly)
StringGadget(3, 8, 85, 306, 20, "minuscules...", #PB_String_LowerCase)
StringGadget(4, 8, 110, 306, 20, "majuscules...", #PB_String_UpperCase)
StringGadget(5, 8, 140, 306, 20, "Gadget saisie de texte sans bordure", #PB_String_BorderLess)
StringGadget(6, 8, 170, 306, 20, "Mot de passe", #PB_String_Password)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf