home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
226-250
/
apd246
/
plaques.amos
/
plaques.amosSourceCode
Wrap
AMOS Source Code
|
1990-10-09
|
2KB
|
75 lines
'
' Plaque Routines - Version 2.0 - June 1991
'
' Jason D Banks
'
' These can make text look pretty, but serve little other purpose
'
' I've been using them in 'Labyrinth' a role-playing game in amos.
' Now I'm scrapping enough cash to get TOME to make it easier so
' I've shelved Labyrinth for now. One day....
'
Screen Open 0,640,256,16,Hires : Curs Off : Flash Off : Pen 1 : Paper 0 : Cls 0
_INIT_PLAQ
PLAQ[20,-1,"greetings|to Thee|From Jason||AND||Enjoy the|Plaques Proggy"]
PLAQ[-1,10,"Plaques - version 1.0"]
PLAQ[-1,-1,"|(c) 1991||J Banks||"]
PLAQ[400,-1," ||||"]
PLAQ[405,-1," |||"]
PLAQ[410,-1," ||"]
PLAQ[415,-1," |"]
Procedure _INIT_PLAQ
If _INIT_ED=True Then Pop Proc
Palette 0,$FFF,$444,$666,$888,$222
Global _INIT_ED
_INIT_ED=True
End Proc
Procedure PLAQ[X,Y,TXT$]
' x = x co-ordinate - if x=-1 then automatically centres the plaq in the screen's x plane.
' y = y co-ordinate - if y=-1 then automatically centres the plaq in the screen's y plane.
' txt$ = text to place in the plaq. This is analyzed to size the plaq's x & y depth
' and the format goes that you use '|' as a seperator so the text "GREETINGS|TO THEE"
' is made up of the two lines "GREETINGS" and "TO THEE".
_GET_MX_X[TXT$] : MX_X=Param
_GET_MX_Y[TXT$] : MX_Y=Param
SX=Screen Width
SY=Screen Height
If X=-1 Then X=(SX/2)-(MX_X*4)
If Y=-1 Then Y=(SY/2)-(MX_Y*4)
_DRAW_PLAQ[X,Y,X+8*MX_X,Y+8*MX_Y,5]
DX=X+4*MX_X
Ink 5,3,
For R=0 To MX_Y-1
A=Instr(TXT$,"|")
If A=0 Then A$=TXT$ : TXT$="" Else A$=Left$(TXT$,A-1) : TXT$=Mid$(TXT$,A+1)
Text DX-(Len(A$)*4),Y+7+8*R,A$
Next R
End Proc
Procedure _DRAW_PLAQ[X1,Y1,X2,Y2,BORD]
' this is the routine that actually draws the border's shell
' note that the minimum border size is 3.
If BORD<3 Then BORD=3
If X1>X2 Then Swap X1,X2
If Y1>Y2 Then Swap Y1,Y2
Ink 2,0,0 : Bar X1-BORD,Y1-BORD To X2+BORD,Y2+BORD
Ink 3,, : Bar X1,Y1 To X2,Y2
Ink 4,,
Polygon X1-BORD,Y1-BORD To X2+BORD,Y1-BORD To X2+BORD,Y2+BORD To X2,Y2 To X2,Y1 To X1,Y1 To X1-BORD,Y1-BORD
End Proc
Procedure _GET_MX_X[T$]
X=0
While Len(T$)>0
A=Instr(T$,"|")
If A=0 Then B=Len(T$) Else If A>X+1 Then X=A-1
If A=0 Then T$="" Else T$=Mid$(T$,A+1)
Wend
If B>X Then X=B
End Proc[X]
Procedure _GET_MX_Y[T$]
Y=0
While Len(T$)>0
Inc Y
A=Instr(T$,"|")
If A>0 Then T$=Mid$(T$,A+1) Else T$=""
Wend
End Proc[Y]