home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-12-30 | 1.9 KB | 66 lines |
- ' Colourshifting text routine
- '
- ' Uses a Spectrum colour palette of 8 colours.
- ' Text colours can "Appear" to move to either the left or right
- ' By changing the value in CSTE to 1 or 0.
- ' This is configured for a Hi resolution screen. Change CHARW to 40 for a
- ' Low resolution screen.
- ' CSTA is the first colour in the palette to be displayed on the screen.
- ' Feel free to use in your own programs.
-
- Default Palette $0,$F,$F00,$F0F,$F0,$FF,$FF0,$FFF
- Global TEX$,CHARW,POSY,CSTA,CSTE
-
- Screen Open 0,640,255,8,Hires : Paper 0 : Cls : Curs Off : Flash Off
- Shift Up 2,1,7,1 : Rem first 10 Colours
- CHARW=80 : Rem 40 chars width max
-
- DAT:
- Data "How do you like this ?","based on an idea done by Carl"
- Data "Drinkwater in FAIRYCAKE 22"," ","You like it?"," "
- Data "It uses a simple Speccy palette,","and makes use of the SHIFT"
- Data "command."," "
- Data "If you are a keen AMOS programmer,","and want to get some good source"
- Data "or programs, then MUSHROOM PD is the","place to begin looking."," "
- Data "This library is dedicated entirely","to AMOS."," "
- Data "write to this address for info :"," "
- Data "Andrew MUSHROOM Kellett","32 Castleton Crescent","Gamesley"
- Data "Glossop","Derbyshire","SK13 9TH","ENGLAND","*"
- Restore
- Read TEX$ : CSTE=0 : POSY=2
-
- Repeat
- If CSTE=1 Then CSTA=1
- If CSTE=0 Then CSTA=1
- Proc _COLOURTEXT
- If CSTE=1 Then CSTE=0 : Goto NXT
- If CSTE=0 Then CSTE=1
- NXT:
- Read TEX$ : Inc POSY
- Until TEX$="*"
-
- Repeat
- Until Mouse Click
-
- Procedure _COLOURTEXT
- POSX=(CHARW-Len(TEX$))/2
- For N=0 To Len(TEX$)-1 : I$=Mid$(TEX$,N+1,1)
- Locate POSX+N,POSY : Pen CSTA : Print I$
- If CSTE=1
- If I$<>" "
- Inc CSTA
- If CSTA=8
- CSTA=1
- End If
- End If
- End If
- If CSTE=0
- If I$<>" "
- Dec CSTA
- If CSTA=0
- CSTA=7
- End If
- End If
- End If
- Next N
- End Proc