home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
routines
/
centext.amos
/
centext.amosSourceCode
Wrap
AMOS Source Code
|
1992-10-04
|
1KB
|
49 lines
' Procedure to centre any text on any AMOS screen
' using the Text command (similar to BASIC Centre command)
' it can also work on a super-bitmap (i.e. bigger than the
' screen)
' Author: Neil Wright
'
Rem *** GOS$ can be any text string that you require ***
Rem *** YTXT refers to the positioning of the text on the y axis ***
Rem *** in SCREEN coordinates ***
'
Rem *** It is interesting to note that AMOS measures the ***
Rem *** y coordinate from the bottom of the text rather than ***
Rem *** the top ***
'
' *** Example 1 ***
Screen Open 0,320,256,4,Lowres
Gosub SET_UP_SCREEN
Proc _CENXTEXT["Centres any text......",100]
Wait 100
Fade 4 : Wait 50
'
' *** Example 2 ***
Screen Open 0,640,256,4,Hires
Gosub SET_UP_SCREEN
Proc _CENXTEXT["On any screen........",100]
Wait 100 : Fade 4 : Wait 50
'
' *** Example 3 ***
Screen Open 0,640,256,4,Lowres
Gosub SET_UP_SCREEN
Ink 2 : Box 11,1 To 639,199
Proc _CENXTEXT["even on a super-bitmap",100]
Wait 100
Channel 1 To Screen Offset 0
Amal 1,"Move 300,0,300"
Amal On 1
Wait 300 : Fade 4 : Wait 50
'
Stop
'
SET_UP_SCREEN:
Curs Off : Flash Off : Hide : Gr Writing 0 : Cls 0 : Ink 2
Return
'
Procedure _CENXTEXT[GOS$,YTXT]
JON=Screen Width
A=Len(GOS$)
Text JON/2-(A*8/2),YTXT,GOS$
End Proc