I'm sorry, but I don't agree. I just tested it and replied to him on the French Discord server, and the results are conclusive. Furthermore, I know someone used the same solution for a video game they created and had no problems. So, I only see corruption; the code doesn't respect or follow conventions and encourages problems.
and video if you want posted under discord too
https://cdn.discordapp.com/attachments/ ... 31f45f4d7&
after updated and improved the code
Code: Select all
InitSprite()
InitKeyboard()
screensize_x.q=800
screensize_y.q=600
OpenWindow(0,100,100,screensize_x,screensize_y,"")
OpenWindowedScreen(WindowID(0),0,0,screensize_x,screensize_y)
StartDrawing(ScreenOutput())
#taille_X=20
#taille_Y=20
temp.q=0
nb.q=-1
offset_x=0
offset_y=400
For y=0 To 15
For x=0 To 15
DrawText(x*#taille_X,y*#taille_Y,Chr(temp),RGB(x*16,y*16,128),0)
temp+1
Next
Next
StopDrawing()
temp=0
For y=0 To 15
For x=0 To 15
GrabSprite(temp,x*#taille_X,y*#taille_Y,#taille_X,#taille_Y)
temp+1
Next
Next
msg$="tien en voila un test et une demo a la con avec un string de text que sa en devien sexy et en bonus le retour a la ligne fais dans le code lui meme avec une detection si le truc va trop loin comme tu peu voir ;)"
*QUICK_EDIT=AllocateMemory($4000)
QUICK_POS.q=Len(msg$)
PokeS(*QUICK_EDIT,msg$,Len(msg$),#PB_Ascii)
Repeat:eee=WindowEvent()
Select eee
Case 0
ClearScreen($000000)
tin+1
temp=0
For y=0 To 15
For x=0 To 15
If IsSprite(temp)
DisplaySprite(temp,x*#taille_X,y*#taille_Y)
EndIf
temp+1
Next
Next
offset_x=0
offset_y=400
For a=0 To $3fff
temp=PeekA(*QUICK_EDIT+a)
If temp=$00:Break:EndIf
If temp=$0D:
offset_y+#taille_Y
offset_x=0:Continue
EndIf
If IsSprite(temp)
DisplaySprite(temp,4+offset_x+Sin(Radian((tin/3.65)+a))*3.84,offset_y+Cos(Radian((tin/1.5)+a))*5.27)
offset_x+#taille_X
If offset_x=>screensize_x
offset_y+#taille_Y
offset_x=0
EndIf
EndIf
Next
FlipBuffers():Delay(16);limite a 60fps pour faire un peu plus propre
Case $100
temp=EventwParam()
Select temp
Case #VK_ESCAPE:eee=#PB_Event_CloseWindow
Case #VK_BACK
If QUICK_POS>0
QUICK_POS-1
PokeA(*QUICK_EDIT+QUICK_POS,0)
EndIf
Case $10
Default
If QUICK_POS<$4000
PokeA(*QUICK_EDIT+QUICK_POS,temp)
QUICK_POS+1
EndIf
EndSelect
EndSelect
Until eee=#PB_Event_CloseWindow
sorry for raw reply in quick time