home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
576-600
/
apd591
/
proc
/
screens
/
rdzone.amos
/
rdzone.amosSourceCode
Wrap
AMOS Source Code
|
1994-02-02
|
1KB
|
33 lines
'*********************************************************
'
'RDZONE[SCRN,Z]
'
'RDZONE sets the shared variables X1,Y1,X2,Y2 to the corner co-ordinates
'of zone Z on screen SCRN, without changing that screen to the current
'screen on exiting.
'
'The procedure returns the parameter True, if the zone existed, false
'if it didn't
'
'NOTE: No error is produced if the zone Z does not exist - the variables
'X1,Y1,X2 & Y2 are not changed in this case.
'
'RdZone is useful for: Using zones for purposes other than mouse/collision
' detection
'
' Getting the zone co-ordinates to pass to screen copy
' it invert a zone (use minterm %110000)
'
Procedure RDZONE[SCRN,Z]
Shared X1,Y1,X2,Y2
A0=Screen : Screen SCRN
If Z>=Deek(Screen Base+214)
A2=False
Else
A1=Leek(Screen Base+210)+(Z-1)*8
X1=Min(Deek(A1),Deek(A1+4)) : Y1=Min(Deek(A1+2),Deek(A1+6))
X2=Max(Deek(A1),Deek(A1+4)) : Y2=Max(Deek(A1+2),Deek(A1+6))
A2=True
End If
Screen A0
End Proc[A2]