BLITDEMO.BAS

Modified on 2016/12/23 23:21 by Administrator — Categorized as: Graphics, _LIB Original MMBasic

This module is part of the original MMBasic library. It is reproduced here with kind permission of Hugh Buckle and Geoff Graham. Be aware it may reference functionality which has changed or is deprecated in the latest versions of MMBasic.

Note: The required SCREEN.BMP is available in the attachments tab (top right).

'------------------------------------
'
'           B L I T   D E M O
'
' A demonstration of the BLIT command
'
'         by Nickolas Marentes
'
'------------------------------------

LoadBMP "screen.bmp"
Color 4
y=159


LOOPSTART:
Timer=0

' SCROLLING PLOT WINDOW

Pixel(453,y)=2
r=Rnd
If r>.75 And y<218 Then y=y+4:GoTo SCROLL
If r<.25 And y>100 Then y=y-4:GoTo SCROLL
If y<159 Then y=y+1:GoTo SCROLL
If y>159 Then y=y-1

SCROLL:
Line -(453,y),2
BLIT 29,95,28,95,426,130,G


' SCROLLING TEXT WINDOW

If t=0 Then GoTo TXA
t=t-1
If t<8 Then GoTo CLRMIX
BLIT 27,257,27,255,182,156
GoTo CLRMIX

TXA:
Color Rnd*7
Print@(35,400)"A scrolling text window"
t=15


' RGB COLOR MIXING

CLRMIX:
If c>110 Then GoTo CLA
BLIT 266,305,267,305,158,44,R
BLIT 267,305,266,305,158,44,B
GoTo CLB

CLA:
BLIT 266,305,267,305,158,44,B
BLIT 267,305,266,305,158,44,R

CLB:
c=c+1
If c>221 Then c=0


Do While Timer<40:Loop
GoTo LOOPSTART