histoire de reprendre un très vieux code
Code : Tout sélectionner
; auteur DOBRO http://michel.dobro.free.fr/ repris par MICOUTE
LoadFont(1, "arial", 50 )
LoadFont(2, "arial", 50 )
Resultat = InitSprite()
Global Angle,amplitude
amplitude=25
Texte.s="Pure Basic 4.10 !"
;{ rajouté par Micoute
Global pref$, NomFichier$ = "C:\Users\"+UserName()+"\AppData\Roaming\PureBasic\PureBasic.prefs"
If OpenPreferences(Nomfichier$) <> 0
If ExaminePreferenceGroups()
While NextPreferenceGroup()
Groupe$ = PreferenceGroupName()
;Debug "nom du groupe : "+Groupe$
PreferenceGroup(Groupe$)
If Groupe$ = "Global"
pref$=ReadPreferenceString("version", "")
Break
EndIf
Wend
EndIf
ClosePreferences()
Texte.s = "PureBasic " + pref$ + "!"
EndIf
;}
WindowID = OpenWindow(1, 50, 50, 640, 200, "hello", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget )
OpenWindowedScreen(WindowID, 0, 0, 640, 200, 1, 0, 0)
CreateImage(100, 640, 100)
StartDrawing( ImageOutput(100))
FrontColor(RGB($0,$FF,$FF))
BackColor(RGB(0, 0, 0))
DrawingFont(FontID(1))
DrawingMode(1)
DrawText(0,0,Texte.s)
StopDrawing()
For t=0 To 100
GrabImage(100, t, 0, t, 640,1)
Next t
Repeat
For y= 0 To 100
StartDrawing(ScreenOutput())
Angle+1 :If Angle=360*100: Angle=0 :EndIf
x=1+(1*Cos(Angle*2*3.1415926/100)*amplitude)+40
x1=1+(1*Sin(Angle*2*3.1415926/100)*amplitude*5)+40
DrawImage( ImageID(y), x+40, x1+y,640,1)
StopDrawing()
dep+1 :If dep>640 :dep=-100:EndIf
Next y
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
Event=WindowEvent()
Delay(1)
Until Event=#PB_Event_CloseWindow