ya qu'a demander
remet ton chemin ligne 4 car j'ai du le modifier pour mon system
(Note qu'avec les Sprites, ce sera bien plus rapide qu'avec les images !! )
et que j'ai garder ton architectures tel quel
on peut faire plus présentable et plus "Pro" (avec l'utilisation d'une Structure par exemple )
et en evitant les lignes a rallonge (utilisation des ":" )
pis j'aime pas les "ElseIf", je prefere les Select Case Endselect
je me suis permis d'ajouter le control de la resolution pour le plein ecran
evidement, il faudra modifier ton algo pour centrer en fonction de la resolution
au moins comme ça le plein ecran s'adapte a toutes les configurations
[reedit]
j'ai aussi corrigé ta boucle d'event , car sinon au bout d'un moment ça plante car tu saturai la liste des events

rajout d'un test ligne 78 car au bout d'un moment on a un plantage car on sort du cadre du tableau
Code : Tout sélectionner
Enumeration
#win
EndEnumeration
If InitSound()=0:MessageRequester("Oops!", "Sound could not be initialized, quitting!"):End:EndIf
If InitSprite()=0:MessageRequester("Oops!","Video could not be initialized, quitting!"):End:EndIf
If InitKeyboard()=0:MessageRequester("Oops!","Keyboard could not be initialized, quitting!"):End:EndIf
UsePNGImageDecoder()
;- initialisation
ExamineDesktops()
DesktopWidth(0)
scrx=DesktopWidth(0) ;=800
scry=DesktopHeight(0) ;600
Global fs
Global Dim gfxfont(60)
Global loop.w ,xp.w , yp.w , t.s , tptr.w , sco.b
xp = 0
yp = 0
title$="Title"
t.s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
;-requester
fs=MessageRequester("Title","FullScreen?",#PB_MessageRequester_YesNoCancel)
select Fs
Case #PB_MessageRequester_No
scrx=800 : scry=600
OpenWindow(#win,0,0,scrx,scry,title$,#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_BorderLess)
OpenWindowedScreen(WindowID(#win),0,0,scrx,scry,0,0,0)
StickyWindow(#win,1)
ShowCursor_(0)
Case #PB_MessageRequester_Yes
OpenScreen(scrx,scry,32, title$)
SetFrameRate(60)
Default
End
EndSelect
;-catchimage
Font = CatchImage(#PB_Any, ?fontcircle)
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Default )
DrawImage(ImageId(Font),0,0)
StopDrawing()
;-GrabSprite
For loop =1 To 60
gfxfont(loop) = GrabSprite(#PB_Any,xp,yp,31,31)
xp = xp + 32
;
If xp > = 320
yp = yp + 32
xp = 0
EndIf
Next
Repeat
Repeat ;Evenement window
if IsWindow(#win)
Event = WaitWindowEvent(2)
Select Event
Case #PB_Event_CloseWindow
End
EndSelect
Endif
Until Event=0
ExamineKeyboard()
;Algo
cco = 0
For cc = 0 To 34
letterc = (Asc(UCase(Mid(t.s, tptr+cc, 1)))-31)
if letterc <0:letterc=-letterc :endif; Rajouter pour eviter un plantage au bout d'un moment
TransparentSpriteColor(gfxfont(letterc),rgb(255,255,255))
DisplayTransparentSprite(gfxfont(letterc), 380+300*-Sin((sco+cco)/270), 320+300*Cos((cco+sco)/90))
cco = cco + 32
Next
sco = sco -2
If sco < -32
tptr = tptr + 1
sco=sco + 32
EndIf
If tptr > (Len(t.s)-30)
tptr = 1
EndIf
FlipBuffers()
ClearScreen($FF0000)
Until KeyboardPushed(#PB_Key_Escape)
End
DataSection
fontcircle:
IncludeBinary"circle.png"
couleur:
EndDataSection