' $Id$ Import noddybox.bitmapfont 'Import "BitmapFont.bmx" Incbin "bmaxtest.bmf" Const SCRW=640 Const SCRH=480 Graphics SCRW,SCRH,32,60 fnt:BitmapFont=BitmapFont.Load("incbin::bmaxtest.bmf") If fnt=Null RuntimeError "Failed to open font" EndIf c=255 ci=-5 Type Star Field x Field y,sp Function Create:Star() Local s:Star=New Star s.x=Rand(0,SCRW) s.y=Rand(0,SCRH) s.sp=Rand(1,3) Return s End Function Method Update() Plot(x,y) y:+sp y:Mod SCRH End Method End Type Const NO=10000 Local st:Star[]=New Star[NO] For f=0 Until NO st[f]=Star.Create() Next While False ' Not KeyHit(KEY_ESCAPE) Cls For f=0 Until NO st[f].Update() Next SetTransform(0,2,2) fnt.DrawColoured("DRAWCOLOURED",0,10,c/2,c/2,c) fnt.Draw("DRAW",c-120,30) fnt.CentreColoured("CENTRECOLOURED",50,c/2,c/2,c) fnt.Centre("CENTRE",70) If Not KeyDown(KEY_P) c:+ci If (c=100 Or c=255) ci=-ci EndIf DrawText(MemAlloced(),0,100) If KeyHit(KEY_SPACE) Then FlushMem Flip Wend sc=10 t$="THIS IS SOME VERY, VERY, *VERY* ~~LARGE SCROLLING TEXT....." x#=0 While Not KeyHit(KEY_ESCAPE) Cls For f=0 Until NO st[f].Update() Next SetTransform(0,1,1) DrawText("x="+x+" width="+(-fnt.TextWidth(t[0..1]))+" mem="+MemAlloced(),0,100) DrawText("t="+t,0,110) SetTransform(0,sc,sc) fnt.Draw(t$,x,200) If Not KeyDown(KEY_P) x:-sc If x<-fnt.TextWidth(t[0..1]) x:+fnt.TextWidth(t[0..1]) t=t[1..]+t[0..1] EndIf EndIf FlushMem Flip Wend