' Ok, this was written to make the tedious task of defining screen zones!
' If you like setting them up then you are a sick, sick, sick!
' When you run the program you will be presented with 3 options -
' MAIN MENU - Takes you to the main part of the Twilight Zone.
' ABOUT - Some garbage about this program!
' QUIT - Like if this needs explaining then see a doctor, OK!?
'On the main screen there are 9 Gadgets (Zones - whatever!) they are -
' LOAD ABK SCREEN - This loads a packed IFF screen that you are using in
' your program, just like this one!
' LOAD IFF SCREEN - Just like above, It loads an IFF picture and displays
' it. A word of warning! Amos does some funny things when
' asked to load some screens - like crash!
' SAVE SOURCE - Selecting this option (After setting up your ZONES!)
' writes an ASCII program which you can merge into your
' own programs. More on this later!
' KILL SOURCE - This will erase all zones/data currently in the data
' banks, there is no confirmation and it is a one way
' trip for the data! Be carefull! The currently loaded
' screen will be kept.
' START OVER - This will do the same as Kill Source but will allow you
' you to load a new picture in and START OVER! Once you
' load a picture and start editing, you cannot load a new
' picture, even if you kill the source.
' QUIT - This of course QUITS. There is checking to see if you
' have saved the data before you quit.
' ADD ZONE - This allows you to draw your zones onto the picture
' you have previously loaded. You cannot start this without
' first loading a picture. Position the pointer at the top
' left of the zone and press and hold the left mouse button
' down to define your ZONE. Once defined you will be asked
' to give it a descriptive name. E.G. For the gadget we
' are talking about we could write "ADDS ZONES TO SCREEN"
' This is placed after the Set Zone command an is nothing
' more than a reminder as to what that zone is there for.
' You will next be asked for a Procedure/Label name. This
' Must be an AMOS LEGAL NAME. This is the name of the
' Procedure/Label you want your program to jump to when
' the zone is hit. One last thing, there is no checking
' for overlapping zones, so be carefull!
' You will be then returned to the main menu!
' TEST ZONES - This brings up a small screen which will display the
' currently selected zone along with it's X&Y Co-Ordinates.
' This feature allows you to test the accuracy of your
' Zones before you save the Source Code!
' Simply click on the screen with the left mouse button,
' A screen will display the hit zone (Accompanied by a bell
' sound) along with the zones Co-Ordinates. You can reposition
' this small screen using the up and down arrows. To
' return to the main menu simply click the right mouse
' button.
' KILL ZONES - This allows you to kill off a zone, it then re-shuffles
' all other zones so that there are no gaps in the list.
' It is similar to the TEST ZONE Function in that it uses
' the same screen to display current zone and Co-Ordinates.
' You can hit the zones using the left mouse button, when
' you have found the zone you want to delete, simply
' select it with the right mouse button. You will not be
' asked to confirm the deletion. It's gone as soon as you
' hit it with the right mouse button! You will then be
' returned back to the main menu.
' Well that about wraps it up for the instructions. A quick note about
' the source code it generates. Below is a sample for this program.
' The Rems are generated by the program, the "'"'s I put there so that you
' don't get any errors when you run this program.
Rem Source Code Generated By
Rem The
Rem TWILIGHT ZONE
Rem Written By TEX!
Rem � 1991 OSCARsoft
Rem THERE IS NO CHECKING FOR OVER-LAPPING ZONES!
Rem
Rem Change The On Statement To Procedures/Gosubs
Rem Or Whatever Yo Like!
' As you can see it's dead simple to use!It even writes a routine for
' checking the zones and the mouse!
' I hope someone can put this to some use, I know that I will because
' thats why I wrote the stupid thing in the first place! There are
' probably heaps of bugs but, what the heck it's only a quick program!
' Let me know if you do find a BUG!
' THE TWILIGHT ZONE ITSELF!
Set Buffer 40
MY=140 : MXG=130
Dim MG(MXG,4),MG$(MXG,1),TMP(MXG,4),TMP$(MXG,1)
Global MY,Q,DM,DS,CZ,NZ,MG(),ZX1,ZX2,ZY1,ZY2,SL,MG$(),TMP(),TMP$()
Screen Open 0,354,290,2,Lowres : Cls 0 : Unpack 10 To 1 : Change Mouse 2
Limit Mouse 0,0 To 800,450 : Get Rom Fonts
L:
Reserve Zone 3
Set Zone 1,491,28 To 622,42
Set Zone 2,491,48 To 622,62
Set Zone 3,491,8 To 622,22
Repeat : MZ=Mouse Zone : MC=Mouse Click : Until MZ>0 and MC=1
On MZ Proc ABOUT,QUIT,MENU
Goto L
Procedure ABOUT
For Y=0 To 138 : Screen Offset 1,,Y : Wait 1 : Next Y
Repeat : Until Mouse Click>0
For Y=138 To 0 Step -1 : Screen Offset 1,,Y : Wait 1 : Next Y
End Proc
Procedure MENU
For Y=0 To 69 : Screen Offset 1,,Y : Wait 1 : Next Y
MAIN:
Screen 1
Reserve Zone 9
Set Zone 1,122,106 To 237,116 : Rem ABK SCREEN
Set Zone 2,122,120 To 237,130 : Rem IFF SCREEN
Set Zone 3,248,106 To 363,116 : Rem SAVE SOURCE
Set Zone 4,248,120 To 363,130 : Rem KILL SOURCE
Set Zone 5,374,106 To 489,116 : Rem START OVER
Set Zone 6,374,120 To 489,130 : Rem QUIT
Set Zone 7,500,92 To 615,102 : Rem ADD ZONE
Set Zone 8,500,106 To 615,116 : Rem TEST ZONE
Set Zone 9,500,120 To 615,130 : Rem KILL ZONE
Gosub USD : Gosub UCD
Repeat
LL:
MZ=Mouse Zone : MC=Mouse Click
A$=Inkey$ : A=Scancode
If A=77 Then Gosub MSD
If A=76 Then Gosub MSU
If MC=2 and SH=0 Then Screen To Back 1 : SH=1 : MC=0 : Goto LL
If MC=2 and SH=1 Then Screen To Front 1 : SH=0 : MC=0 : Goto LL
Until MZ>0 and MC=1
On MZ Goto BK,FF,SS,KS,SO,QUIT,AZ,TZ,KZ
BK:
If SL=1 Then Bell : Goto MAIN
F$=Fsel$("*.ABK","","SELECT AN .ABK PICTURE FILE","The TWILIGHT ZONE � 1991 OSCARsoft")
If F$="" Then Goto MAIN
' IF YOU WANT TO CHECK WHAT .ABK FILE YOU ARE ABOUT TO LOAD
' THEN EXAMINE THESE LINES OF CODE!
' THEY CHECK FOR EVERY TYPE OF BANK POSSIBLE WITH AMOS
Open In 1,F$
D$=Input$(1,30)
Close 1
If Left$(D$,4)="AmSp" Then Bell : INFOSCREEN[3] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Samples")>0 Then Bell : INFOSCREEN[4] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Amal")>0 Then Bell : INFOSCREEN[5] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Music")>0 Then Bell : INFOSCREEN[6] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Datas")>0 Then Bell : INFOSCREEN[7] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Work")>0 Then Bell : INFOSCREEN[8] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Left$(D$,4)="AmIc" Then Bell : INFOSCREEN[9] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Menu")>0 Then Bell : INFOSCREEN[10] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
If Instr(D$,"Pac.Pic")=0 Then Bell : INFOSCREEN[11] : Bell : Wait 500 : Screen Close 7 : Goto MAIN
Load F$,15 : Unpack 15 To 2 : Erase 15 : Screen To Front 1 : SL=1 : Goto MAIN
FF:
If SL=1 Then Bell : Goto MAIN
F$=Fsel$("","","SELECT AN IFF PICTURE FILE","The TWILIGHT ZONE � 1991 OSCARsoft")
If F$="" Then Goto MAIN
Load Iff F$,2 : Screen To Front 1 : SL=1 : Goto MAIN
SS:
If NZ=0 Then Goto MAIN
F$=Fsel$("*.ASC","","SELECT A SAVE NAME FOR THE SOURCE CODE","The TWILIGHT ZONE � 1991 OSCARsoft")
If F$="" Then Goto MAIN
E$=Right$(F$,4) : E$=Upper$(E$) : If E$<>".ASC" Then F$=F$+".ASC"
Change Mouse 3
Open Out 1,F$
Print #1,"Rem"
Print #1,"Rem Source Code Generated By"
Print #1,"Rem The"
Print #1,"Rem TWILIGHT ZONE"
Print #1,"Rem Written By TEX!"
Print #1,"Rem � 1991 OSCARsoft"
Print #1,"Rem"
Print #1,"Reserve Zone"+Str$(NZ)
Print #1,"Rem"
For X=1 To NZ
Print #1,"Set Zone"+Str$(X)+","+Mid$(Str$(MG(X,0)),2)+","+Mid$(Str$(MG(X,1)),2)+" to "+Mid$(Str$(MG(X,2)),2)+","+Mid$(Str$(MG(X,3)),2)+": Rem "+MG$(X,0)
Next X
Print #1,"Rem"
Print #1,"Rem THERE IS NO CHECKING FOR OVER-LAPPING ZONES!"
Print #1,"Rem"
Print #1,"Repeat"
Print #1,"MZ=Mouse Zone : MC=Mouse Click"
Print #1,"Until MZ>0 and MC=1"
For X=1 To NZ
N$=N$+MG$(X,1)+","
Next X
N=Len(N$) : N$=Left$(N$,N-1)
Print #1,"On MZ Goto "+N$
Print #1,"Rem"
Print #1,"Rem Change The "+Chr$(32)+"On"+Chr$(32)+" Statement To Procedures/Gosubs"
Print #1,"Rem Or Whatever Yo Like!"
Close 1
Change Mouse 2
DS=1
Goto MAIN
KS:
For X=1 To NZ
MG(X,0)=0 : MG(X,1)=0 : MG(X,2)=0 : MG(X,3)=0
Next X
NZ=0 : CZ=0
Goto MAIN
SO:
If NZ>0 and SL=1 Then SL=0 : Screen Close 2
Goto KS
AZ:
If SL=0 Then Bell : INFOSCREEN[1] : Bell : Wait 400 : Screen Close 7 : Goto MAIN