Ok I'm done this is my entry, I use a grip load of function but the end results are quite simple. Bahhh saving part was hell!
set display mode 640,480,32
sync on
sync rate 0
create bitmap 1,640,480
dim color(1,2)
color(0,0) = 155
color(0,1) = 155
color(0,2) = 155
color(1,0) = 255
color(1,1) = 255
color(1,2) = 255
do
cls 0
gosub MainMenu
if State = 0 then gosub State0
if State = 1 then gosub State1
if State = 2 then gosub State2
if State = 3 then gosub State3
if State = 4 then gosub State4
copy bitmap 1,0
sync
loop
MainMenu:
Check = menu(500,300,100,"Box,Box Color,Text,Text Color,Save & Quit",1)
if Check = 1 then State = 0 : KeyM = 2
if Check = 2 then State = 1
if Check = 3 then State = 2
if Check = 4 then State = 3
if Check = 5 then State = 4
REM Box
ink rgb(color(0,0),color(0,1),color(0,2)),0
box x1,y1,x2,y2
REM TEXT
ink rgb(color(1,0),color(1,1),color(1,2)),0
if State = 2 then blink$ = Blinker() else blink$ = ""
text textX,textY,Text$+blink$
return
State0:
ink rgb(255,255,255),0
text 0,0,"Click and Drag to draw your box. Press Enter when done."
mx = mousex()
my = mousey()
mc = mouseclick()
if mc = 1
if KeyM = 0
x1 = mx
y1 = my
KeyM = 1
endif
if KeyM = 1
x2 = mx
y2 = my
endif
else
KeyM = 0
endif
return
State1:
Check = menu(400,300,30,"Red,Grn,Blu",1)
Check = menu(440,300,10,"<,<,<",1)
if check = 1 & color(0,0) > 0 then color(0,0) = color(0,0) - 1
if check = 2 & color(0,1) > 0 then color(0,1) = color(0,1) - 1
if check = 3 & color(0,2) > 0 then color(0,2) = color(0,2) - 1
Check = menu(455,300,20,str$(color(0,0))+","+str$(color(0,1))+","+str$(color(0,2)),1)
Check = menu(480,300,10,">,>,>",1)
if check = 1 & color(0,0) < 255 then color(0,0) = color(0,0) + 1
if check = 2 & color(0,1) < 255 then color(0,1) = color(0,1) + 1
if check = 3 & color(0,2) < 255 then color(0,2) = color(0,2) + 1
return
State2:
ink rgb(255,255,255),0
text 0,0,"Select an area and type in text."
mx = mousex()
my = mousey()
mc = mouseclick()
if mc = 1 then TextX = mx: TextY = my
Text$ = Typing(Text$,0,0)
return
State3:
Check = menu(400,300,30,"Red,Grn,Blu",1)
Check = menu(440,300,10,"<,<,<",1)
if check = 1 & color(1,0) > 0 then color(1,0) = color(1,0) - 1
if check = 2 & color(1,1) > 0 then color(1,1) = color(1,1) - 1
if check = 3 & color(1,2) > 0 then color(1,2) = color(1,2) - 1
Check = menu(455,300,20,str$(color(1,0))+","+str$(color(1,1))+","+str$(color(1,2)),1)
Check = menu(480,300,10,">,>,>",1)
if check = 1 & color(1,0) < 255 then color(1,0) = color(1,0) + 1
if check = 2 & color(1,1) < 255 then color(1,1) = color(1,1) + 1
if check = 3 & color(1,2) < 255 then color(1,2) = color(1,2) + 1
return
State4:
if file exist("Codes.txt") = 1 then delete file "Codes.txt"
open to write 1,"Codes.txt"
write string 1,"sync on : sync rate 0 : create bitmap 1,640,480"
write string 1,"do"
write string 1,"cls 0 : ink "+str$(rgb(color(0,0),color(0,1),color(0,2)))+",0"
write string 1,"box "+str$(x1)+","+str$(y1)+","+str$(x2)+","+str$(y2)
write string 1,"ink "+str$(rgb(color(1,0),color(1,1),color(1,2)))+",0"
write string 1,"text "+str$(textX)+","+str$(textY)+","+chr$(34)+Text$+chr$(34)
write string 1,"check = CheckArea("+str$(x1)+","+str$(y1)+","+str$(x2)+","+str$(y2)+")"
write string 1,"if check = 1 then end"
write string 1,"copy bitmap 1,0 : sync"
write string 1,"loop"
write string 1,"Function CheckArea(x1,y1,x2,y2)"
write string 1," retval = 0"
write string 1," mx = mousex()"
write string 1," my = mousey()"
write string 1," mc = mouseclick()"
write string 1," if mx > x1-1 & mx < x2+1 & my-1 > y1 & my+1 < y2 & mc = 1 then retval = 1"
write string 1,"EndFunction retval"
close file 1
end
return
REM ------------------------------------------------------------------------
REM Functions Section
REM Menus
Function Menu(x,y,length,Menu$,Mode)
dim MenuList$(20)
retval = 0
count = 0
rows = 0
repeat
g$ = ""
i$ = ""
repeat
count = count + 1
g$ = mid$(Menu$,count)
if g$ <> "," then i$ = i$ + g$
until g$ = "," or count > len(Menu$)
MenuList$(rows) = i$
rows = rows + 1
until count > len(Menu$)
if mode = 0
repeat
keys = Keys(1)
if keys = 1 then retval = retval - 1
if keys = 4 then retval = retval + 1
if retval < 0 then retval = rows-1
if retval > rows-1 then retval = 0
for lp = 0 to rows-1
MenuBox(x,y+lp*32,length)
ink rgb(0,0,0),0 : center text x+length/2,y+lp*32+7,MenuList$(lp)
next lp
pointer(x,y+retval*32)
copy bitmap 1,0
sync
until returnkey() = 1
retval = retval + 1
endif
if mode = 1
for lp = 0 to rows-1
MenuBox(x,y+lp*32,length)
ink rgb(0,0,0),0 : center text x+length/2,y+lp*32+7,MenuList$(lp)
check = CheckArea(x,y+lp*32,x+length+2,y+lp*32+28+2)
if check = 1 then retval = lp+1
next lp
endif
EndFunction retval
REM Pointer
Function Pointer(x,y)
ink rgb(0,0,255),0
box x,y,x+10,y+10
endFunction
REM Menu Box
Function MenuBox(x,y,length)
ink rgb(10,10,10),0 : box x-2,y-2,x+length+2,y+28+2
ink rgb(230,230,230),0 : box x-1,y-1,x+length+1,y+28+1
ink rgb(180,180,180),0 : box x,y,x+length,y+28
EndFunction
REM Screen Fades
Function ScreenFade(Speed)
for lpx = 255 to 0 step Speed
set gamma lpx,lpx,lpx
copy bitmap 1,0
sync
next lpx
cls 0
set gamma 255,255,255
EndFunction
REM Check Area
Function CheckArea(x1,y1,x2,y2)
retval = 0
mx = mousex()
my = mousey()
mc = mouseclick()
if mx > x1-1 & mx < x2+1 & my-1 > y1 & my+1 < y2 & mc = 1 then retval = 1
EndFunction retval
REM Mode0 = normal, Mode1 = once per press.
Function Keys(mode)
retval = 0
if leftkey() = 1
if mode = 0 then retval = 2
if mode = 1 & KeyL = 0 then retval = 2
KeyL = 1
else
KeyL = 0
endif
if rightkey() = 1
if mode = 0 then retval = 3
if mode = 1 & KeyR = 0 then retval = 3
KeyR = 1
else
KeyR = 0
endif
if upkey() = 1
if mode = 0 then retval = 1
if mode = 1 & KeyU = 0 then retval = 1
KeyU = 1
else
KeyU = 0
endif
if downkey() = 1
if mode = 0 then retval = 4
if mode = 1 & KeyD = 0 then retval = 4
KeyD = 1
else
KeyD = 0
endif
EndFunction retval
Function Typing(TypingMod$,TypingL,TypingMode)
REM Inputs Keys from Keyboard to modify String$
REM Typing Limit, Zero will make it unlimited suposively.
REM TypingMode0 = all Letters, Typingmode1= only Numbers
if TypingL = 0 Then TypingL = 1000
REM Typing Input.
TypingI$ = inkey$()
REM Reset TypingG$ if there's no input.
if TypingI$ = "" then TypingG$ = ""
REM Reset keyTyping if BackSpace is not pressed.
if asc(TypingI$) <> 8 then KeyTyping = 0
REM BackSpace is Pressed. Erase one off of TypingMod$.
if asc(TypingI$) = 8
REM If first time pressing BackSpace
if KeyTyping = 0
REM Resets the TypingCounter used to time the key repeat.
TypingC = 0
REM Checks if String$ has anything.
if len(TypingMod$) > 0
REM Erase the last letter in TypingMod$.
TypingMod$ = left$(TypingMod$,len(TypingMod$)-1)
endif
endif
REM Flag this variable to not alow TypingMod$ erase.
KeyTyping = 1
REM Clear the input so it's not added to TypingG$
TypingI$=""
REM Handle the repeat of BackSpace
inc TypingC,1
if TypingC > 6 then KeyTyping = 0
endif
REM Setting up variable for checks.
z = asc(TypingI$)
REM Only numbers can pass
if TypingMode = 1 & z > 57 or TypingMode = 1 & z < 48 then TypingI$=""
REM Only letters can pass
if TypingMode = 0 & z > 127 or TypingMode = 0 & z < 32 then TypingI$=""
REM Checks if new/old Input are different and TypingMod$ is in Limit.
if TypingG$ <> TypingI$ & len(TypingMod$) < TypingL then TypingMod$=TypingMod$+TypingI$
REM Stores the last Input. Used for checking key repeat.
TypingG$ = TypingI$
EndFunction TypingMod$
REM File Input Opuput Function <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function Blinker()
Blink = Blink + 1
if Blink > 3
Blink = 0
if Blinker$ = "" then Blinker$ = "|" else Blinker$ = ""
endif
EndFunction Blinker$
This saves to a file call Codes.txt