PicoMiteVGA DEMO


Author Message
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 572
Posted: 04:49pm 03 Apr 2025      

  Volhout said  In PicoMite there is the SPRITE SCROLL command that scrolls a selected layer.
This command does the same as the above 4 lines.
Sprite scroll 0,1

The SPRITE SCROLL command can scroll all directions up/down/left/right. Individual, and simultaneous (diagonal).

Hi Volhout,
Thank you for the tip, I must have missed it. It makes it look much easier.
Regards,javavi.
Const Mode.N=2
Const Font.N=1
Const T.Scale=4
Const T.Size=Len(Time$)
MODE  Mode.N
Const X.Res=MM.HRES,Y.Res=MM.VRES
Font  Font.N
Const X.FSize=MM.Info(FONTWIDTH)
Const Y.FSize=MM.Info(FONTHEIGHT)
Const X.Offset=X.FSize*T.Scale*T.Size\2
Const Y.Offset=Y.FSize*T.Scale\2
Dim integer X.Dir=1,Y.Dir=1
Dim integer X.Pos=MM.HRES\2,Y.Pos=MM.VRES\2
Dim integer FC,BC
Dim Clr(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map Clr(),Clr()
'=================================================
FRAMEBUFFER LAYER 0
FRAMEBUFFER WRITE L
Font 9
Do
If BC=0 Then
 BC=Int(Rnd*15)+1
 Colour Clr(BC)
 Print @(0,0);
 For n=1 To (X.Res\8)*(Y.Res\8)
   Print Chr$(32+Int(Rnd*3));
 Next
EndIf

Sprite scroll X.Dir,Y.Dir
Pause 20

FRAMEBUFFER WRITE N
If FC=0 Then FC=Int(Rnd*15)+1
Text X.Pos,Y.Pos,Time$,"CM",Font.N,T.Scale,Clr(FC)
Inc X.Pos,X.Dir:Inc Y.Pos,Y.Dir
If X.Pos-X.Offset<0 Then X.Dir=1:FC=0
If X.Pos+X.Offset>MM.HRES Then X.Dir=-1:FC=0
If Y.Pos-Y.Offset<0 Then Y.Dir=1
If Y.Pos+Y.Offset>MM.VRES Then Y.Dir=-1:BC=0
FRAMEBUFFER WRITE L
Loop While Inkey$=""
'================================================
DefineFont 9
04200808
80402010 08040201
01020408 10204080
08080808 08080808
End DefineFont