LB Booster
« Nice to see you are back Richard. »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:45am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Nice to see you are back Richard.  (Read 247 times)
michael
New Member
Image


member is offline

Avatar




PM


Posts: 28
xx Nice to see you are back Richard.
« Thread started on: Feb 15th, 2016, 07:56am »

I am currently working on a useful tool for the public to use to simplify in program image creation.
The snippet I sent you is not the final product.

I plan to also add here some flexible utilities that a person can INCLUDE in their projects.. Like movement recorders and graphics subroutines.

This program will allow you to make precision draws with mouse and color mixer with help built in and then you can make graphics modules to include for special displays or images.

This is radically improved..
I am developing this for all LBB and LB Users..

I am accepting any suggestions for improvement.
I hope you like it.
Code:
on error goto [Error]
  dim info$(10,10)
  DIM li$(100)' you can adjust this if you really need more editor space
 global errstate$
 global lin
 global ideloc
 global r
 global g
 global b
 bmpbutton #h.3.red, "bmp\redbttn.bmp",redclicked, UR,10,10
 bmpbutton #h.3.blue, "bmp\bluebttn.bmp",blueclicked , UR, 10,130
 bmpbutton #h.3.green, "bmp\grnbttn.bmp",greenclicked, UR, 10,70
 bmpbutton #h.3.mred, "bmp\blank5.bmp",mredclicked, UR, 10,40
 bmpbutton #h.3.mblue, "bmp\blank4.bmp",mblueclicked, UR, 10,160
 bmpbutton #h.3.mgreen, "bmp\blank3.bmp",mgreenclicked, UR, 10,100
 bmpbutton #h.3.all, "bmp\grphbttn.bmp",allclicked, UR, 100,160
 bmpbutton #h.3.minusall, "bmp\sqrbttn.bmp",minusallclicked, UR, 130, 160
 bmpbutton #h.3.load,"bmp\OPEN.bmp",[loadit],UR 10,200
 bmpbutton #h.3.save,"bmp\SAVE.bmp",[saveit],UR 10,230
 bmpbutton #h.3.compile,"bmp\xxRun.bmp",[compileit],UR 10,260
 bmpbutton #h.4.helpmsg,"bmp\help.bmp",[HELPME],LL 950,50
 lin =0
 r=50
 g=50
 b=50
call screen 1200,600
#h.4 "cls;place 10 30;down;backcolor 120 130 125;color white;fill 120 130 125"
#h.4 "\ Click on the ? to get helpful hints-"
errstate$="no"
gcolor$="white"
#h.2, "down;place 10 40;color blue;\";li$(lin);"_"
#h.3 "down;color 140 75 145;backcolor black;place 10 330"
#h.3 "\Hold Left or Right Mouse Button"
#h.3 "place 10 350;\to get a location (needs movement)"
#h.3 "color green;place 150 215;\LOAD"
#h.3 "place 150 245;\SAVE"
#h.3 "place 145 275;\COMPILE"
scan
#h.1 "when leftButtonMove [mouseloc]"
#h.1 "when rightButtonMove [rmouseloc]"
   #h.2 "setfocus;place 10 20"
   #h.2 "when characterInput [inp]"
[back]
   wait
[quit]'*************************************************************************************
 timer 0
  #h.1 "discard"
 'print #ide, txt$
 'close #ide
 close #h
 end
 [HELPME]
 #h.4 "cls;place 10 30;down;backcolor 120 130 125;color white;fill 120 130 125"
 if hmn> 8 then hmn=0
 if hmn=0 then #h.4 "\Type commands like:             down;color green;line 100 100 200 200;circle 100"
 if hmn=1 then #h.4 "\ USE ARROW KEYS TO SCROLL UP AND DOWN THE EDITOR-"
 if hmn=2 then #h.4 "\<ENTER> does a line return and auto runs and updates draw."
 if hmn=3 then #h.4 "\ Dont forget to type 'down' at the start of your code and dont forget a 'color'"
 if hmn=4 then #h.4 "\ Use your Left Mouse Button activate areas you need to use"
 if hmn=5 then #h.4 "\ When you click COMPILE it saves to 'A draw in basic.bas'"
 if hmn=6 then #h.4 "\ When you click on SAVE it saves to 'A Notbasic.bas'"
 if hmn=7 then #h.4 "\ The COMPILER makes draws with #h.1 on each line. Make your graphics box same"
 if hmn=8 then #h.4 "\ the semicolon can separate many commands: 'backcolor green;fill green;cls'"
 hmn=hmn+1
 goto [back]
 [Error]'***********************************************************************************
  notice "YOUR ERROR IS: ";li$(lin);"..Try again "
'  empty the string so its no longer an error
  txt$=""
  li$(lin)=""
errstate$="yes"
Resume
end
[mouseloc]
#h.3 "down;color black;backcolor black;place 10 310"
#h.3 "\Left click was at ";moux;",";mouy
#h.3 "down;color white;backcolor black;place 10 310"
moux= MouseX
mouy= MouseY
#h.3 "\Left click was at ";moux;",";mouy
goto [back]
[rmouseloc]
#h.3 "down;color black;backcolor black;place 10 290"
#h.3 "\Right click was at ";mx;",";my
#h.3 "down;color white;backcolor black;place 10 290"
mx= MouseX
my= MouseY
#h.3 "\Right click was at ";mx;",";my
goto [back]

[compileit]
gfile$="A draw in basic.bas"
poz=0'  temporary variable for increment for array
open gfile$ for output as #fil
while li$(poz)<>""
thestring$= li$(poz)
print #fil, "#h.1 ";chr$(34);thestring$;chr$(34)
poz=poz+1
wend
close #fil
goto [back]
end
' **********************************************************<OPEN FILE>*(HAS REDIM FOR li$(number))
[loadit]
gfile$="A Notbasic.bas"
poz=0'temporary variable for increment for array
REDIM li$(100)
if fileExists(DefaultDir$, "A Notbasic.bas") then
open gfile$ for input as #fil
while eof(#fil) > -1
input #fil, thestring$
 li$(poz)=thestring$
poz=poz+1
wend
close #fil
else
fexists$=""
end if
txt$=li$(0)
goto [back]
end
function fileExists(path$, filename$)
   'dimension the array info$( at the beginning of your program
   files path$, filename$, info$()
   fileExists = val(info$(0, 0)) 'non zero is true
 end function
' **********************************************************<SAVE FILE>*********************
[saveit]
gfile$="A Notbasic.bas"
poz=0'  temporary variable for increment for array
open gfile$ for output as #fil
while li$(poz)<>""
thestring$= li$(poz)
print #fil, thestring$
poz=poz+1
wend
close #fil
goto [back]
end
[inp]'*******************************************************Character Input BEGINS -Find accepted key presses ******
   ch$ = Inkey$
   #h.2 "down;backcolor 180 180 180;fill 180 180 180;color blue"' ***********Refresh TEXT screen
   c2$=left$(ch$, 1)
   if asc(ch$) >32 and asc(ch$)<127 then txt$=txt$+ch$
   if ch$=" " then txt$=txt$+" "
   if asc(ch$) =8 then sl= len(txt$)-1:s1$= mid$(txt$,1,len(txt$)-1):txt$= s1$:#h.2 "cls"
   if len(Inkey$)>1 then
        key1$=right$(Inkey$,1)
        key2$=left$(Inkey$,1)
    else
        key1$=Inkey$
        key2$=""
    end if
   ' print len(Inkey$),
    if key2$="" then print " ", else print asc(key2$),
    ch=asc(key1$)
    #h.2 "backcolor 150 150 150;fill 180 180 180 ;cls;color blue"

    if asc(ch$)= 13 then call runit'*********************************THE DRAW************************
      lpos0$= str$(lin-1)+"   "
    lpos1$= str$(lin)+"   "
    lpos2$= str$(lin+1)+"   "
      if lin>0 then print #h.2, "place 10 20;\";lpos0$;"";li$(lin-1)
#h.2, "place 10 40;\";lpos1$;"";li$(lin);"_"
    if lin<500 then print #h.2, "place 10 60;\";lpos2$;"";li$(lin+1)
    li$(lin)=txt$ ' this line will make issues if it is active
    if ch=37 then curs=curs-1
    if ch=39 then curs=curs+1
    if ch=38 then lin=lin-1
    if lin<0 then lin=0
    if ch=40 then lin=lin+1
    if ch$="(" then lin=lin-1
    if asc(ch$) =13 then if errstate$="no" then lin=lin+1
    if errstate$="yes" then errstate$="no"
    if lin>100 then lin=100'
    lpos0$= str$(lin-1)+"   "
    lpos1$= str$(lin)+"   "
    lpos2$= str$(lin+1)+"   "
    txt$=li$(lin)
    #h.2 "backcolor 180 180 180;fill 180 180 180;cls"'<<<<<<<<<<<<<<<<<<<<TEXT
    if lin>0 then print #h.2, "place 10 20;\";lpos0$;"";li$(lin-1)
    #h.2, "place 10 40;\";lpos1$;"";li$(lin);"_"
    if lin<100 then print #h.2, "place 10 60;\";lpos2$;"";li$(lin+1)
 '**************************
 goto [back]
 wait
sub runit
tl=0
#h.1 "place 0 0;down;cls"
[cyclerun]
if len(li$(tl))=0 then goto [getout]
#h.1 "down;";li$(tl)
tl=tl+1
goto [cyclerun]
[getout]
end sub
'****************************************COLOR SELECTION TOOL**
sub allclicked bttnHandle$
 r=r+5
 g=g+5
 b=b+5
 if r>255 then r=0
 if g>255 then g=0
 if b>255 then b=0
 call mixedcolor
 end sub
 sub minusallclicked bttnHandle$
 r=r-5
 g=g-5
 b=b-5
 if r < 0 then r=255
 if g < 0 then g=255
 if b < 0 then b=255
 call mixedcolor
 end sub
 sub redclicked bttnHandle$
 r=r+5
 if r > 255 then r=0
 call mixedcolor
 end sub
 sub blueclicked bttnHandle$
 b=b+5
 if b > 255 then b=0
 call mixedcolor
 end sub
 sub greenclicked bttnHandle$
 g=g+5
 if g >255 then g=0
 call mixedcolor
 end sub
 sub mgreenclicked bttnHandle$
 g=g-5
 if g<0 then g=255
 call mixedcolor
 end sub
 sub mblueclicked bttnHandle$
 b=b-5
 if b<0 then b=255
 call mixedcolor
 end sub
 sub mredclicked bttnHandle$
 r=r-5
 if r<0 then r=255
 call mixedcolor
 end sub
sub mixedcolor
 #h.3 "flush"
 #h.3 "place 120 80"
 #h.3 "down"
 rgb$= str$(r)+" "+str$(g)+" "+str$(b)
 #h.3 "color ";r;" ";g;" ";b
 #h.3 "backcolor "; rgb$
 #h.3 "ellipsefilled 100 100"
 #h.3 "place 10 10"
 #h.3 " color white"
 #h.3 " backcolor black"
 #h.3 "\The colors are ";r;" ";g;" ";b;"***"
#h.3 "flush"
end sub
'******************* SCREEN***************
sub screen x,y
nomainwin
WindowWidth=x
WindowHeight=y
UpperLeftX=1
UpperLeftY=1
global ch$
global txt$
global name$
global name1$
global getsizeh' globals have been moved to make it a cleaner interface
global getsizev
graphicbox #h.1, 0,0,949,450
graphicbox #h.2, 0,500,1200,600
graphicbox #h.3, 950,1,1200,450
graphicbox #h.4, 0,451,949,499
open "THE FIRST REAL TIME GRAPHICS IDE (USE MOUSE LEFT BUTTON TO RIGHT CLICK ON WORK AREAS TO MAKE THEM WORK" for window_nf as #h
print #h, "trapclose [quit]"
print #h.1, "down;backcolor black;fill black"
print #h.2, "down;backcolor black;fill 180 180 180"
print #h.3, "down;backcolor black;fill black"
print #h.4, "down;backcolor black;fill 120 130 125"
end sub



 
User IP Logged

I make program generators and some utilities. Its my hobby
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls