Hi, (Goodmorning).
First some screenshots:
and
and the help files:
and a link:
http://www.madglue.com/pics/soul.zip
and the source:
` soul ...
sync off
`
dir1$=get dir$()
dir2$="Help"
dir3$="Pics"
`
dw=get display width():dh=get display height():dd=get display depth()
set display mode dw,dh,dd,1
set window on
maximize window
resetMainWindow
`
colourb as dword
colourt as dword
backcolour as dword
toolcolour as dword
fcol as dword
col as dword
colbuz as dword
`
global oldx_result
global oldy_result
global textx
global texty
`
#constant all1 5001
#constant clone1 5002
#constant clone2 5003
#constant blur2 5004
#constant buz1 5005
#constant file1 5006
#constant file2 5007
#constant zoom1 5008
#constant zoom2 5009
#constant zoom3 5010
#constant zoom4 5011
#constant zoom5 5012
`
dim line$(20) : line_num=1
dim tab_dim$(50) : dim image(50)
`
startblue "?","?"
`
gosub create_main_menu_sub
gosub create_icons
gosub read_tool_text
gosub create_tool_icons_sub
gosub create_bottom_panel_sub
gosub create_rightclick_menu_sub
gosub create_floater_sub
gosub some_variables_sub
gosub tool_size_panels
gosub update_bottom_panel
`
do
`cls rgb(br,bg,bb)
gosub delete_sub
`
getevent
if id>0 and mouseposx()>50 and mouseposy()<gadgety(bottom_panel) then change mouse 2
`
gosub check_icon_moves_sub
gosub check_icon_clicks_sub
gosub go_master_tools_sub
gosub pick_back_colour_button
gosub pick_tool_colour_button
gosub pick_back_colour_sub
gosub pick_tool_colour_sub
gosub process_main_menu_sub
gosub toolsize
gosub tool_size_panels
gosub update_bottom_panel
gosub hide_floater
`
oldx_result=old_x()
oldy_result=old_y()
`
loop
`
`
` (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
` ````````````````` pre loop subs ````````````````````````````
`` )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
` create icon graphics
create_icons:
cls rgb(208,212,200) : ink 0,0
` pencil
box 5,5,15,15
get image 1,0,0,22,22,1
cls rgb(208,212,200)
` sketch
line 3,3,18,18
ink rgb(200,200,200),0
for t = 3 to 15 step 3
dot t,t
next t
get image 2,0,0,22,22,1
cls rgb(208,212,200)
`
` slant
ink 0,0
line 3,3,18,18
get image 3,0,0,22,22,1
cls rgb(208,212,200)
`
` duct
line 3,3,18,3: line 18,3,18,18:line 3,18,18,18:line 3,3,3,18
get image 4,0,0,22,22,1
cls rgb(208,212,200)
` chain
circle 10,10,7
get image 5,0,0,22,22,1
cls rgb(208,212,200)
` spray
for t = 0 to 50
ang=rnd(360)
rad=rnd(9)
dot 10+sin(ang)*rad,10+cos(ang)*rad
next t
get image 6,0,0,22,22,1
cls rgb(208,212,200)
` fan
for t = 0 to 360 step 36
ang=t
rad=5+rnd(5)
line 11,11,11+sin(ang)*rad,11+cos(ang)*rad
next t
get image 7,0,0,22,22,1
cls rgb(208,212,200)
` `
` cross
ink 0,0
line 3,11,18,11:line 11,3,11,18
get image 8,0,0,22,22,1
cls rgb(208,212,200)
` polygon
line 7,3,15,3:line 15,3,18,11:line 18,11,17,18:line 17,18,6,18:line 6,18,4,11:line 4,11,7,3
get image 9,0,0,22,22,1
cls rgb(208,212,200)
` shade fill
circle 11,11,8
ink rgb(rnd(155),rnd(55),rnd(55)),0
center text 11,3,"F"
get image 10,0,0,22,22,1
cls rgb(208,212,200)
` shade fill extra
ink rgb(rnd(150),rnd(150),rnd(150)),0
ellipse 11,11,10,8
ink rgb(rnd(155),rnd(55),rnd(55)),0
center text 11,3,"Fx"
get image 11,0,0,22,22,1
cls rgb(208,212,200)
`
` text
center text 6,5,"T"
ink rgb(255,0,0),0
center text 15,5,"t"
get image 12,0,0,22,22,1
cls rgb(208,212,200) : ink 0,0
`
` undo
set text size 20
center text 11,3,"un"
get image 13,0,0,22,22,1
cls rgb(208,212,200)
` redo
center text 11,5,"re"
get image 14,0,0,22,22,1
cls rgb(208,212,200)
`
` select
for t = 3 to 18 step 2
dot t,3
dot 18,t
dot t,18
dot 3,t
next t
get image 15,0,0,22,22,1
cls rgb(208,212,200)
`
` resize
line 5,5,5,15:line 5,15,15,15
line 3,8,5,5 : line 7,8,5,5
line 12,12,15,15:line 12,18,15,15
get image 16,0,0,22,22,1
cls rgb(208,212,200)
`
` mirror
ink 0,0
line 3,11,18,11
line 3,11,6,8:line 3,11,6,14
line 18,11,15,8:line 18,11,15,14
get image 17,0,0,22,22,1
cls rgb(208,212,200)
`
` rotate
ink 0,0
circle 11,11,6
ink rgb(208,212,200),0
box 0,11,11,22
ink 0,0
line 5,11,3,8:line 5,11,8,9
line 11,17,14,14:line 11,17,14,20
get image 18,0,0,22,22,1
cls rgb(208,212,200)
`
` canvas
for t = 18 to 3 step -1
ink rgb(255,122,122),0
line 3,t,t,t
ink rgb(112,122,255),0
line t,t,18,t
next t
get image 19,0,0,22,22,1
cls rgb(208,212,200) : ink 0,0
` zoom
center text 10,3,"Zi"
get image 20,0,0,22,22,1
cls rgb(208,212,200)
`
` zoom back
center text 10,3,"Zb"
get image 21,0,0,22,22,1
cls rgb(208,212,200)
`
` paste full
ink rgb(222,222,0),0
for t = 3 to 18 step 2
line t,3,t,18
next t
ink rgb(122,22,22),0
center text 11,5,"P"
get image 22,0,0,22,22,1
cls rgb(208,212,200)
` paste transparent
ink rgb(122,22,22),0
center text 11,5,"P"
get image 23,0,0,22,22,1
cls rgb(208,212,200)
`
` erazer
ink rgb(122,122,0),0
center text 11,5,"Er"
get image 24,0,0,22,22,1
cls rgb(208,212,200)
`
` blur
ink rgb(0,155,0),0
center text 22,3,"blur"
get image 25,0,0,47,22,1
cls rgb(208,212,200)
`
` buzz selection
ink rgb(0,155,0),0
center text 23,3,"Buzz"
get image 26,0,0,47,22,1
cls rgb(208,212,200)
`
` open
ink rgb(255,0,0),0
center text 23,3,"Open"
get image 27,0,0,47,22,1
cls rgb(208,212,200)
`
` open transparent
ink rgb(255,0,0),0
center text 23,3,"OpenT"
get image 28,0,0,47,22,1
cls rgb(208,212,200)
` save
center text 23,3,"Save"
get image 29,0,0,47,22,1
cls rgb(208,212,200)
`
` save selection
ink rgb(255,0,0),0
center text 23,3,"Selec."
get image 30,0,0,47,22,1
cls rgb(208,212,200)
`
` new
center text 23,3,"New"
get image 31,0,0,47,22,1
cls rgb(208,212,200)
`
cls
set dir dir1$
set dir dir2$
set dir dir3$
`
for t = 1 to 31
save image str$(t)+".jpg",t
next t
set dir dir1$
`
return
`
` put tool tab texts to an array
read_tool_text:
for t = 1 to 31
read tab_dim$(t)
next t
return
`
` create and place tool icons
create_tool_icons_sub:
leftpanel=createPanel(0,0,51,0,0)
setPanelBorderStyle leftpanel,1
setGadgetAlign leftpanel,3
`
for n = 1 to 31
if n<13 then image(n)=createPanel(0,(n-1)*25,25,25,leftpanel)
if n>12 and n<25 then image(n)=createPanel(25,(n-1)*25-300,25,25,leftpanel)
if n>24 then image(n)=createPanel(0,(n-1)*25-300,50,25,leftpanel)
`
setPanelBorderStyle image(n),1
setPanelimage image(n),n
next n
return
`
`
` create bottom panel
create_bottom_panel_sub:
bottom_panel=createPanel(0,426,632,25,0)
setPanelBorderStyle bottom_panel,1
setGadgetAlign bottom_panel,5
font1=createFont("ariel", 12, 0, 0,0)
applyFont bottom_panel, font1
setGadgetText bottom_panel, " "+str$(mousex())+","+str$(mousey())
setAutoUpdate bottom_panel, 1
`
toolcol=createPanel(0,0,25,25,bottom_panel)
setPanelBorderStyle toolcol,1
setAutoUpdate toolcol, 1
backcol=createPanel(25,0,25,25,bottom_panel)
setPanelBorderStyle backcol,1
setAutoUpdate backcol, 1
toolx=createPanel(50,0,35,25,bottom_panel)
applyFont toolx, font1
setGadgetText toolx, str$(toolsizex)
setAutoUpdate toolx, 1
setPanelBorderStyle toolx,1
tooly=createPanel(85,0,35,25,bottom_panel)
applyFont tooly, font1
setGadgetText tooly, str$(toolsizey)
setAutoUpdate tooly, 1
setPanelBorderStyle tooly,1
`
return
`
` create main menu
create_main_menu_sub:
main=createMenu(0)
addMenuItem main, "File", 101
addMenuItem main, "Help", 102
file_menu=createSubMenu(main,101)
addMenuItem file_menu, "New", 201
addMenuItem file_menu, "open image file", 202
addMenuItem file_menu, "open image file, Transparent", 203
addMenuItem file_menu, "save image file", 204
addMenuItem file_menu, "save selection, image file", 205
return
`
` create rightclick menu
create_rightclick_menu_sub:
rightclick=createPopupMenu()
addMenuItem rightclick, "Tools", 501
tool_menu=createsubmenu(rightclick,501)
addMenuItem tool_menu, "Pencil", 301
addMenuItem tool_menu, "Sketch", 302
addMenuItem tool_menu, "Slant", 303
addMenuItem tool_menu, "Duct", 304
addMenuItem tool_menu, "Chain", 305
addMenuItem tool_menu, "Spray", 306
addMenuItem tool_menu, "Fan", 307
addMenuItem tool_menu, "Cross", 308
addMenuItem tool_menu, "Polygon", 309
addMenuItem tool_menu, "Shade Fill", 310
addMenuItem tool_menu, "Shade Fill Extra", 311
addMenuItem tool_menu, "Text", 312
addMenuItem rightclick, "Undo", 313
addMenuItem rightclick, "Redo", 314
addMenuItem rightclick, "Manipulate", 502
manipulate_menu=createsubmenu(rightclick,502)
addMenuItem manipulate_menu, "Select", 315
addMenuItem manipulate_menu, "Resize", 316
addMenuItem manipulate_menu, "Mirror", 317
addMenuItem manipulate_menu, "Rotate", 318
addMenuItem rightclick, "Canvas", 319
addMenuItem rightclick, "Zoom", 320
addMenuItem rightclick, "Zoom Back", 321
addMenuItem rightclick, "Paste Full", 322
addMenuItem rightclick, "Paste Transperent", 323
addMenuItem rightclick, "Eraze", 324
addMenuItem rightclick, "Blur", 325
addMenuItem rightclick, "Buzz", 326
addMenuItem rightclick, "File", 502
rightclick_file_menu=createsubmenu(rightclick,502)
addMenuItem rightclick_file_menu, "Open Image File", 327
addMenuItem rightclick_file_menu, "Open Image File, Transparent", 328
addMenuItem rightclick_file_menu, "Save Image File", 329
addMenuItem rightclick_file_menu, "Save Selection", 330
addMenuItem rightclick_file_menu, "New", 331
addMenuItem rightclick, "Colour", 503
rightclick_colour_menu=createsubmenu(rightclick,503)
addMenuItem rightclick_colour_menu, "Background Colour Pick", 332
addMenuItem rightclick_colour_menu, "Tool Colour Pick", 333
`
return
`
` create floater panel
create_floater_sub:
floater=createPanel(0, 0, 0, 0, 0)
setPanelBorderStyle floater,1
setGadgetColor floater, rgb(155,155,0),0
font2=createFont("ariel",9,0,1,0)
applyFont floater, font2
bfloater=createPanel(0, 0, 0, 0, 0)
setPanelBorderStyle bfloater,1
setGadgetColor bfloater, rgb(0,155,155),0
font2=createFont("ariel",9,0,1,0)
applyFont bfloater, font2
return
`
` some variables
some_variables_sub:
r=rnd(222):g=rnd(222):b=rnd(222)
br=222:bg=222:bb=222
cls rgb(br,bg,bb)
fan_count=1
undo=2000
tracex=1:tracey=1:tracex1=2:tracey1=2
return
` ###############################################################################
` ++++++++++++++++++++++++++++++++++++looped subs +++++++++++++++++++++++++++++++++++
`@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
` delete selected area
delete_sub:
if KEYSTATE(211)=1 then ink rgb(br,bg,bb),0:box tracex,tracey,tracex1,tracey1:xsleep(200)
return
`
` check icon moves
check_icon_moves_sub:
if mouseposx()<50
for n = 1 to 31
if eventSource()=image(n) and eventType()=MOUSE_MOVE
`pass=gadgetUnderMouse()
setGadgetText floater, tab_dim$(n)
textx=gettextwidth(floater, tab_dim$(n))
texty=gettextheight(floater, tab_dim$(n))
`
setGadget floater, mouseposx()+30, mouseposy(),textx,texty
setgadgetvisible floater,1
bringtofront floater
paintgadget floater
endif
next n
endif
return
`
` check icon clicks
check_icon_clicks_sub:
if mouseposx()<50
for n = 1 to 31
if eventSource()=image(n) and eventType()=MOUSE_CLICK
id=n+300
ttx=0:tty=0:ttx1=0:tty1=0
rotate=0:sx=0:sy=0
endif
next n
if eventType()=MOUSE_CLICK and id<>313 and id<>314 and id<>315 and id<>320
get image all1,50,0,dw,dh,1
gosub save_undo_image
`
if image exist(all1)=1 then paste image all1,50,0
endif
endif
return
`
` check for rightclick stuff
go_master_tools_sub:
if id>300
gosub tools_master
endif
`
return
`
` pick back colour from button
pick_back_colour_button:
if eventSource()=backcol and eventType()=MOUSE_CLICK
backcolour=colorDialog()
br=rgbr(backcolour)
bg=rgbg(backcolour)
bb=rgbb(backcolour)
endif
return
` :` pick tool colour from button
pick_tool_colour_button:
if eventSource()=toolcol and eventType()=MOUSE_CLICK
toolcolour=colorDialog()
r=rgbr(toolcolour)
g=rgbg(toolcolour)
b=rgbb(toolcolour)
endif
return
`
pick_back_colour_sub:
if id=331 :` pick back colour from richtclick
if mouseclick()=1
colourb=point(mousex(),mousey())
br=rgbr(colourb)
bg=rgbg(colourb)
bb=rgbb(colourb)
id=0
endif
endif
return
`
pick_tool_colour_sub:
if id=332 :` pick tool colour from right click
if mouseclick()=1
colourt=point(mousex(),mousey())
r=rgbr(colourt)
g=rgbg(colourt)
b=rgbb(colourt)
id=0
endif
endif
return
`
`
process_main_menu_sub:
ink 0,0 : line 0,1,dw,1
if eventType()=MENU_CLICK
select eventData()
case 102 :` help
execute file "soul_help.exe", "", "",1
endcase
case 201 :` new
gosub new_sub
endcase
case 202 :` open image file
gosub open_sub
endcase
case 203 :` open image file , transparent
gosub open_transparent_sub
endcase
case 204 :` save image file
gosub save_sub
endcase
case 205 :` save selection
gosub save_selection_sub
endcase
endselect
endif
return
`
` toolsize
toolsize:
if upkey()=1 then inc toolsizey : inc toolsizey,tool_zoomy : xsleep(160)
if downkey()=1 then dec toolsizey : inc toolsizey,tool_zoomy : xsleep(160)
if leftkey()=1 then dec toolsizex : inc toolsizex,tool_zoomx : xsleep(160)
if rightkey()=1 then inc toolsizex : inc toolsizex,tool_zoomx : xsleep(160)
if toolsizex<1 then toolsizex=1
if toolsizey<1 then toolsizey=1
`
return
`
` bottom panel floater
bfloater_on:
textx=gettextwidth(bfloater, b_tab$)
texty=gettextheight(bfloater, b_tab$)
setGadgetText bfloater, b_tab$
setGadget bfloater, mouseposx()+30, mouseposy()-30,textx,texty
setgadgetvisible bfloater,1
bringtofront bfloater
paintgadget bfloater
return
`
` hide floater
hide_floater:
if mousePosX()>50 or mouseposy()>475
setgadgetvisible floater,0
sendtoback floater
setgadget floater,-200,-200,1,1
endif
return
`
`
` save undo image
save_undo_image:
if id<>311 and id<>312
undo=undo+1
undo_total=undo
if undo_total>2005 and image exist(undo-5)=1 then delete image undo-5
if undo_total>2005 and file exist(str$(undo-5)+".jpg")=1 then delete file str$(undo-5)+".jpg"
get image undo,50,0,dw,dh,1
`if image exist(undo)=1 then save image str$(undo)+".jpg",undo
endif
return
`
` toolsize reset stuff
tool_size_panels:
setGadgetText toolx, str$(toolsizex)
setGadgetText tooly, str$(toolsizey)
if eventSource()=toolx and eventType()=MOUSE_CLICK then toolsizex=1
if eventSource()=tooly and eventType()=MOUSE_CLICK then toolsizey=1
return
`
` update bottom panel
update_bottom_panel:
` colour gadgets update values
setGadgetColor toolcol, rgb(r,g,b),0
setGadgetColor backcol,rgb(br,bg,bb),0
` file name and mouse position text on bottom panel
if fileS$="" then fileS$="untitled"
setGadgetText bottom_panel, " "+str$(mouseposx())+","+str$(mouseposy())+" "+fileS$
`
`
if eventSource()=toolcol and eventType()=MOUSE_MOVE
b_tab$ = "click to choose tool colour"
gosub bfloater_on
endif
if eventSource()=backcol and eventType()=MOUSE_MOVE
b_tab$ = "click to choose background colour"
gosub bfloater_on
endif
if eventSource()=toolx or eventSource()=tooly and eventType()=MOUSE_MOVE
b_tab$ = "click to set to 1"
gosub bfloater_on
endif
`
if mouseposy() < gadgetY(bottom_panel)
setgadgetvisible bfloater,0
positiongadget bfloater,-200,-200
endif
`
return
`
tools_master:
`
`
`
` pencil
if id=301
pencil_sub:
ink rgb(r,g,b),0
if mouseclick()=1
if oldx_result>50 and oldy_result>0
for t = 0 to toolsizex
for u = 0 to toolsizey
line oldx_result+t,oldy_result+u,mousex()+t,mousey()+u
next u
next t
endif
endif
return
endif
`
` sketch
if id=302
sketch_sub:
if mouseclick()=1
ttx = mousex()
tty = mousey()
inc sketch_count
if sketch_count>abs((mousemovex()+mousemovey())/2) then ttx1=ttx:tty1=tty:sketch_count=0
if ttx1>1 and tty1>1
ink rgb(r,g,b),0
if mouseposx()>50
if oldx_result>50 and oldy_result>0 and sketch_count=abs((mousemovex()+mousemovey())/2)
for t = 0 to toolsizex
for u = 0 to toolsizey
line oldx_result+t,oldy_result+u,mousex()+t,mousey()+u
next u
next t
endif
endif
endif
endif
if mouseclick()=0 then sketch_count=1
return
endif
`
` slant
if id=303
slant_sub:
if mouseclick()=1
if mouseposx()>50
ttx=mousex():tty=mousey()
ink rgb(r,g,b),0
line ttx,tty,ttx+sin(toolsizex)*toolsizey+1,tty+cos(toolsizex)*toolsizey+1
endif
endif
return
endif
`
` duct
if id=304
duct_sub:
if mouseposx()>50
if mouseclick()=1
ttx = mousex()
tty = mousey()
ink rgb(r,g,b),0
if mouseposx()>50
line ttx,tty,ttx+toolsizex,tty
line ttx+toolsizex,tty-toolsizey,ttx+toolsizex,tty
line ttx,tty-toolsizey,ttx+toolsizex,tty-toolsizey
line ttx,tty-toolsizey,ttx,tty
endif
endif
endif
return
endif
`
` chain
if id=305
chain_sub:
ink rgb(r,g,b),0
if mouseclick()=1
ttx = mousex()
tty = mousey()
if ttx>50
if mouseposx()>50 then ellipse ttx,tty,oldx_result-ttx+toolsizex,oldy_result-tty+toolsizey
endif
endif
return
endif
`
` spray
if id=306
spray_sub:
if mouseclick()=1
ink rgb(r,g,b),0
ttx=mousex():tty=mousey()
for x=1 to toolsizey
ang=rnd(360)
rad=rnd(toolsizey)
if mouseposx()>50
dot ttx+sin(ang)*rad,tty+cos(ang)*rad
endif
next x
endif
return
endif
`
` fan
if id=307
fan_sub:
ink rgb(r,g,b),0
ttx=mousex():tty=mousey()
if mouseclick()=1 and pnt=0
ink rgb(r,g,b),0
ttx1=ttx:tty1=tty
inc fan_count
pnt=1
endif
if pnt = 1 and fan_count>1
ttx2=ttx1
tty2=tty1
ttx3=ttx:tty3=tty
endif
`
fx1=ttx2:fy1=tty2
fx2=ttx3:fy2=tty3
`if ttx1>0 then line fx1,fy1,fx2,fy2
if mouseposx()>50 then line fx1,fy1,fx2,fy2
`
if mouseclick()=0 and pnt=1
pnt=2 : fan_count=1
endif
if pnt=2 and fan_count=1 and ttx1>0
pnt=0
endif
return
endif
`
` cross
if id=308
cross_sub:
if mouseclick()=1
ttx=mousex():tty=mousey()
ink rgb(r,g,b),0
if mouseposx()>50
line ttx-toolsizex,tty,ttx+toolsizex,tty
line ttx,tty-toolsizey,ttx,tty+toolsizey
endif
endif
return
endif
`
` polygon
if id=309
polygon_sub:
if mouseclick()=1 and poly=0 and mousex()>60 then ttx=mousex() : tty=mousey() : poly=1 : xsleep(200)
if poly=1
ttx1=mousex() : tty1=mousey()
ink rgb(r,g,b),0
if mouseclick()=1
if ttx>60 and tty>0
if ttx1>60 and tty1>0
for t = 0 to 5
if mouseposx()>50
line ttx+rnd(t),tty+rnd(t),ttx1+rnd(t),tty1+rnd(t)
line ttx+t,tty+t,ttx1+t,tty1+t
endif
next t
endif
endif
ttx=0:tty=0:ttx1=0:tty1=0
poly=0
endif
if returnkey()=1 then ttx=0:tty=0:ttx1=0:tty1=0:poly=0:id=0
endif
return
endif
`
` shade fill
if id=310
shade_fill_sub:
sync on
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if mouseclick()=1
lock pixels
`
x1=mousex():y1=mousey():x2=mousex():y2=mousey()
fcol=point(mousex(),mousey())
fr=rgbr(fcol)
fg=rgbg(fcol)
fb=rgbb(fcol)
stop=0
repeat
`
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir =0 then inc x1 : inc y1
if fill_dir =1 then dec x1 : inc y1
col=point(x1,y1)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
ink rgb(r,g,b),0
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x1,y1 else stop=1
`
until stop=1
stop=0
repeat
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir=0 then dec x2 : dec y2
if fill_dir=1 then inc x2 : dec y2
col=point(x2,y2)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x2,y2 else stop=1
until stop=1
stop=0
unlock pixels
endif
sync
sync off
return
endif
`
` shade fill extra
if id=311
shade_fill_extra_sub:
sync on
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
`
if mouseclick()=1
lock pixels
`
x1=mousex():y1=mousey():x2=mousex():y2=mousey()
fcol=point(mousex(),mousey())
fr=rgbr(fcol)
fg=rgbg(fcol)
fb=rgbb(fcol)
stop=0
re=r-30+rnd(60):ge=g-30+rnd(60):be=b-30+rnd(60)
if re<0 or re>255 then re=rnd(255)
if ge<0 or ge>255 then ge=rnd(255)
if be<0 or be>255 then be=rnd(255)
repeat
`
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir =0 then inc x1 : inc y1
if fill_dir =1 then dec x1 : inc y1
col=point(x1,y1)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
ink rgb(re,ge,be),0
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x1,y1 else stop=1
`
until stop=1
stop=0
`
repeat
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir=0 then dec x2 : dec y2
if fill_dir=1 then inc x2 : dec y2
col=point(x2,y2)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x2,y2 else stop=1
until stop=1
stop=0
unlock pixels
endif
sync
sync off
return
endif
`
` text
if id=312
text1_sub:
if mouseclick()=1
line_num=1
xsleep(200)
get image all1,0,0,dw,dh,1
clear entry buffer : line$(line_num)=""
repeat
cls
if image exist(all1)=1 then paste image all1,0,0
new$=entry$()
for n=1 to len(new$)
if asc(mid$(new$,n))=8
line$(line_num)=left$(line$(line_num),len(line$(line_num))-1)
else
if returnkey()=0 then line$(line_num)=line$(line_num)+mid$(new$,n)
endif
if returnkey()=1 then line$(line_num)="" : clear entry buffer
next n
clear entry buffer
if returnkey()=1 then inc line_num: xsleep(300)
`
if toolsizex#>160 then toolsizex#=160
if toolsizex#<10 then toolsizex#=10
if leftkey()=1 then dec toolsizex#,0.1
if rightkey()=1 then inc toolsizex#,0.1
toolsizex=toolsizex#
set text size toolsizex
ink rgb(r,g,b),0
text mousex(),mousey(),line$(1)
text mousex(),mousey()+((toolsizex+1)*1),line$(2)
text mousex(),mousey()+((toolsizex+1)*2),line$(3)
text mousex(),mousey()+((toolsizex+1)*3),line$(4)
text mousex(),mousey()+((toolsizex+1)*4),line$(5)
text mousex(),mousey()+((toolsizex+1)*5),line$(6)
text mousex(),mousey()+((toolsizex+1)*6),line$(7)
text mousex(),mousey()+((toolsizex+1)*7),line$(8)
text mousex(),mousey()+((toolsizex+1)*8),line$(9)
text mousex(),mousey()+((toolsizex+1)*9),line$(10)
text mousex(),mousey()+((toolsizex+1)*10),line$(11)
`
until mouseclick()=1
`
id=0
endif
`
return
endif
`
` undo
if id=313
undo_sub:
if image exist(undo-1)=1 then undo=undo-1
if image exist(undo)=1 then paste image undo,50,0 : ` undo
id=0
return
endif
` redo
if id=314
redo_sub:
if image exist(undo+1)=1 then undo=undo+1
if image exist(undo)=1 then paste image undo,50,0 : ` redo
id=0
return
endif
`
` select and copy
if id=315
select_and_copy_sub:
` select and copy
get image all1,0,0,dw,dh,1
if mouseclick()=1
paste_on=0
tracex=mousex():tracey=mousey()
repeat
cls 0
if image exist(all1)=1 then paste image all1,0,0
ink 0,0
line tracex,tracey,mousex(),tracey
line mousex(),tracey,mousex(),mousey()
line tracex,mousey(),mousex(),mousey()
line tracex,tracey,tracex,mousey()
until mouseclick()=0
tracex1=mousex()
if tracex1>dw then tracex1=dw
if tracex>tracex1
tracex2=tracex1 : tracex1=tracex : tracex=tracex2
endif
`
tracey1=mousey()
if tracey1>dh then tracey1=dh
if tracey>tracey1
tracey2=tracey1 : tracey1=tracey : tracey=tracey2
endif
`
cls
if image exist(all1)=1 then paste image all1,0,0
if tracex>1 and tracex1>tracex then get image clone2,tracex,tracey,tracex1,tracey1,1
if file exist("Y.bmp")=1 then delete file "Y.bmp"
`if image exist(clone2)=1 then save image "Y.bmp",clone2
id=0
endif
return
endif
`
` resize
if id=316
resize_sub:
get image all1,0,0,dw,dh
`
if tracex>1 and tracex1>tracex then get image clone1,tracex,tracey,tracex1,tracey1,1
if file exist("X.bmp")=1 then delete file "X.bmp"
`if image exist(clone1)=1 then save image "X.bmp",clone1
if image exist(clone1)=1
sprite clone1,mousex(),mousey(),clone1
sw=sprite width(clone1):sh=sprite height(clone1)
endif
`
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(clone1)=1 then sprite clone1,mousex(),mousey(),clone1
if sprite exist(clone1)=1 then offset sprite clone1,(sw/2)+(sx/2),(sh/2)+(sy/2)
if sw+sx>2 and sh+sy>2 and sprite exist(clone1)=1 then size sprite clone1,sw+sx,sh+sy
if leftkey()=1 then dec sx
if rightkey()=1 then inc sx
if downkey()=1 then dec sy
if upkey()=1 then inc sy
`
until mouseclick()>0
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(clone1)=1 then paste sprite clone1,mousex(),mousey()
if sprite exist(clone1)=1 then delete sprite clone1
id=0
`
return
endif
`
` mirror selection
if id=317
mirror_selection_sub:
ink rgb(br,bg,bb),0
box tracex,tracey,tracex1,tracey1
get image all1,0,0,dw,dh,1
if image exist(clone2)=1 then sprite clone2,mousex(),mousey(),clone2
if sprite exist(clone2)=1 then mirror sprite clone2
`
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(clone2)=1 then sprite clone2,mousex(),mousey(),clone2
if sprite exist(clone2)=1 then offset sprite clone2,(tracex1-tracex)/2,(tracey1-tracey)/2
if sprite exist(clone2)=1 then rotate sprite clone2,rotate
if leftkey()=1 then dec rotate : `xsleep(100)
if rightkey()=1 then inc rotate : `xsleep(100)
if rotate<0 then rotate=360
if rotate>360 then rotate=0
until mouseclick()>0
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(clone2)=1 then paste sprite clone2,mousex(),mousey()
if sprite exist(clone2)=1 then delete sprite clone2
id=0
return
endif
`
` rotate selection
if id=318
rotate_selection_sub:
ink rgb(br,bg,bb),0
box tracex,tracey,tracex1,tracey1
get image all1,0,0,dw,dh,1
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(clone2)=1 then sprite clone2,mousex(),mousey(),clone2
if sprite exist(clone2)=1 then offset sprite clone2,(tracex1-tracex)/2,(tracey1-tracey)/2
if sprite exist(clone2)=1 then rotate sprite clone2,rotate
if inkey$()="," then dec rotate : `xsleep(100)
if inkey$()="." then inc rotate : `xsleep(100)
if rotate<0 then rotate=360
if rotate>360 then rotate=0
`
until mouseclick()>0
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(clone2)=1 then paste sprite clone2,mousex(),mousey()
if sprite exist(clone2)=1 then delete sprite clone2
id=0
return
endif
`
` canvas
if id=319
canvas_sub:
change mouse 1
get image all1,0,0,dw,dh,1
if image exist(all1)=1 then paste image all1,0,0
fpSelected = point(0,0)
pr=rgbr(fpSelected)
pg=rgbg(fpSelected)
pb=rgbb(fpSelected)
`
ink 0,0
lock pixels
for t = 0 to dw
for u = 0 to dh
BColSelected = point(t,u)
fr=rgbr(BColSelected)
fg=rgbg(BColSelected)
fb=rgbb(BColSelected)
if fr>pr-8 and fr<pr+8 and fg>pg-8 and fg<pg+8 and fb>pb-8 and fb<pb+8 then dot t,u
next u
next t
unlock pixels
`
get image all1,0,0,dw,dh,1
cls rgb(br,bg,bb)
if image exist(all1)=1 then paste image all1,0,0,1
id=0
change mouse 0
`
return
endif
`
` zooooooooooomm
if id=320
zoom_sub:
`
tracex2 = tracex1 - tracex
tracey2 = tracey1 - tracey
if tracex2>1 and tracey2>1
tool_zoomx = (dw/tracex2)+2
tool_zoomy = (dh/tracey2)+2
`
get image all1,0,0,dw,dh,1
get image zoom1,tracex,tracey,tracex1,tracey1,1
get image zoom5,0,0,dw,dh,1
if image exist(zoom1)=1 then save image "zoom1.bmp",zoom1
if image exist(zoom5)=1 then save image "zoom5.bmp",zoom5
if file exist("zoom1.bmp")=1 then load bitmap "zoom1.bmp",1
if image exist(zoom1)=1 then delete image zoom1
`
COPY BITMAP 1,0,0,tracex2,tracey2,0,0,0,dw,dh
delete bitmap 1
get image zoom2,0,0,dw,dh,1
if image exist(zoom2)=1 then save image "zoom2.bmp",zoom2
if image exist(zoom2)=1 then delete image zoom2
`
toolsizex =toolsizex*tool_zoomx
toolsizey =toolsizey*tool_zoomy
id=0
xsleep(200)
endif
return
endif
`
` zooooooooomm back
if id=321
zoom_back_sub:
if tracex2>0 and tracey2>0
get image all1,0,0,dw,dh,1
get image zoom3,0,0,dw,dh,1
if image exist(zoom3)=1 then save image "zoom3.bmp",zoom3
if file exist("zoom3.bmp")=1 then load bitmap "zoom3.bmp",1
if image exist(zoom3)=1 then delete image zoom3
`
copy bitmap 1,0,0,dw,dh,0,0,0,tracex2,tracey2
delete bitmap 1
get image zoom4,0,0,tracex2,tracey2
if image exist(zoom4)=1 then save image "zoom4.bmp",zoom4
if image exist(zoom5)=1 then paste image zoom5,0,0
if image exist(zoom4)=1 then paste image zoom4,tracex,tracey
if image exist(zoom5)=1 then delete image zoom5
if image exist(zoom4)=1 then delete image zoom4
tool_zoomx = 0
tool_zoomy = 0
tracex=0:tracey=0:tracex1=0:tracey1=0:tracex2=0:tracey2=0
toolsizex=1:toolsizey=1
if file exist("zoom1.bmp")=1 then delete file "zoom1.bmp"
if file exist("zoom2.bmp")=1 then delete file "zoom2.bmp"
if file exist("zoom3.bmp")=1 then delete file "zoom3.bmp"
if file exist("zoom4.bmp")=1 then delete file "zoom4.bmp"
if file exist("zoom5.bmp")=1 then delete file "zoom5.bmp"
id=0
xsleep(200)
endif
return
endif
`
` paste full paste full
if id=322
paste_full_sub:
change mouse 1
get image all1,0,0,dw,dh,1
if image exist(clone2)=1
sprite clone2,-200,-200,clone2
sw=sprite width(clone2):sh=sprite height(clone2)
endif
`
change mouse 0
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(clone2)=1 then sprite clone2,mousex(),mousey(),clone2
if sprite exist(clone2)=1 then offset sprite clone2,(sw/2)+(sx/2),(sh/2)+(sy/2)
if sprite exist(clone2)=1 then rotate sprite clone2,rotate
if inkey$()="," then dec rotate
if inkey$()="." then inc rotate
if rotate<0 then rotate=360
if rotate>360 then rotate=0
`
if sw+sx>2 and sh+sy>2 then size sprite clone2,sw+sx,sh+sy
if leftkey()=1 then dec sx
if rightkey()=1 then inc sx
if downkey()=1 then dec sy
if upkey()=1 then inc sy
`
until mouseclick()>0
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(clone2)=1 then paste sprite clone2,mousex(),mousey()
if sprite exist(clone2)=1 then delete sprite clone2
sy=0 : sx=0
id=0
xsleep(200)
return
endif
`
` paste transparent
if id=323
paste_transparent_sub:
change mouse 1
get image all1,0,0,dw,dh,1
if paste_on=1 then goto skip_transparent
lock pixels
ink 0,0
lock pixels
for t = tracex to tracex1
for u = tracey to tracey1
BColSelected = point(t,u)
fr=rgbr(BColSelected)
fg=rgbg(BColSelected)
fb=rgbb(BColSelected)
ink 0,0
if fr>br-8 and fr<br+8 and fg>bg-8 and fg<bg+8 and fb>bb-8 and fb<bb+8 then dot t,u
next u
next t
unlock pixels
if tracex>1 and tracex1>tracex then get image clone1,tracex,tracey,tracex1,tracey1,1
if file exist("X.bmp")=1 then delete file "X.bmp"
`if image exist(clone1)=1 then save image "X.bmp",clone1
skip_transparent:
if image exist(all1)=1 then paste image all1,0,0
`
if image exist(clone1)=1
sprite clone1,-200,-200,clone1
sw=sprite width(clone1):sh=sprite height(clone1)
endif
`
change mouse 0
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(clone1)=1 then sprite clone1,mousex(),mousey(),clone1
if sprite exist(clone1)=1 then offset sprite clone1,(sw/2)+(sx/2),(sh/2)+(sy/2)
if sprite exist(clone1)=1 then rotate sprite clone1,rotate
if inkey$()="," then dec rotate
if inkey$()="." then inc rotate
if rotate<0 then rotate=360
if rotate>360 then rotate=0
if sw+sx>2 and sh+sy>2 then size sprite clone1,sw+sx,sh+sy
if leftkey()=1 then dec sx
if rightkey()=1 then inc sx
if downkey()=1 then dec sy
if upkey()=1 then inc sy
until mouseclick()>0
`
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(clone1)=1 then paste sprite clone1,mousex(),mousey()
if sprite exist(clone1)=1 then delete sprite clone1
paste_on=1
sy=0 : sx=0
id=0
xsleep(200)
`
return
endif
`
` eraze / rubber
if id=324
eraze_sub:
ink rgb(br,bg,bb),0
if mouseclick()=1
if oldx_result>50 and oldy_result>0
for t = 0 to toolsizex
for u = 0 to toolsizey
line oldx_result+t,oldy_result+u,mousex()+t,mousey()+u
next u
next t
endif
endif
return
endif
`
` blur that selection
if id=325
blur1_sub:
change mouse 1
if tracex>1 and tracex1>tracex
get image blur2,tracex,tracey,tracex1,tracey1,1
if image exist(blur2)=1 then save image "blur.bmp",blur2
if image exist(blur2)=1 then delete image blur2
load bitmap "blur.bmp",1
if toolsizex>8 then toolsizex=8
blur bitmap 1,toolsizex
get image blur2,0,0,tracex1-tracex,tracey1-tracey,1
delete bitmap 1
`
if image exist(blur2)=1 then paste image blur2,tracex,tracey : delete image blur2
`
if file exist("blur.bmp")=1 then delete file "blur.bmp"
id=0
endif
change mouse 0
`
return
endif
`
` buzz that selection
if id=326
buz1_sub:
change mouse 1
if tracex>1 and tracex1>tracex
rn=-50+rnd(100)+toolsizex:gn=-50+rnd(100)+toolsizex:bn=-50+rnd(100)+toolsizex:allrn=rnd(255):allgn=rnd(255):allbn=rnd(255)
get image buz1,tracex,tracey,tracex1,tracey1,1
if image exist(buz1)=1 then save image "buz.bmp",buz1
if image exist(buz1)=1 then delete image buz1
load bitmap "buz.bmp",1
lock pixels
for t = 0 to tracex1-tracex
for u = 0 to tracey1-tracey
colbuz=point(t,u)
rbuz = rgbr(colbuz)
gbuz = rgbg(colbuz)
bbuz = rgbb(colbuz)
if rbuz=br and gbuz=bg and bbuz=bb
ink rgb(br,bg,bb),0
`
dot t,u
else
`
rbuz = rbuz+rn
if rbuz<0 then rbuz=allrn
if rbuz>255 then rbuz=allrn
`
gbuz = gbuz+gn
if gbuz<0 then gbuz=allgn
if gbuz>255 then gbuz=allgn
`
bbuz = bbuz+bn
if bbuz<0 then bbuz=allbn
if bbuz>255 then bbuz=allbn
`
ink rgb(rbuz,gbuz,bbuz),0
dot t,u
endif
next u
next t
unlock pixels
get image buz1,0,0,tracex1-tracex,tracey1-tracey,1
delete bitmap 1
`
if image exist(buz1)=1 then paste image buz1,tracex,tracey : delete image buz1
`
if file exist("buz.bmp")=1 then delete file "buz.bmp"
id=0
endif
`
change mouse 0
return
endif
`
` open image file
if id=327
open_sub:
get image all1,0,0,dw,dh,1
fileO$=openDialog("Open image file","Image File (*.bmp)|*.bmp|Image File (*.jpg)|*.jpg")
if fileO$>""
load image fileO$,file1
if image exist(file1)=1 then sprite file1,-200,-200,file1
sw=sprite width(file1) : sh=sprite height(file1)
`
repeat
if image exist(all1)=1 then paste image all1,0,0
if image exist(file1)=1 then sprite file1,mousex(),mousey(),file1
if sprite exist(file1)=1 then offset sprite file1,sprite width(file1)/2,sprite height(file1)/2
if upkey()=1 then inc toolsizey,4
if downkey()=1 then dec toolsizey,4
if leftkey()=1 then dec toolsizex,4
if rightkey()=1 then inc toolsizex,4
if toolsizex<1-sw then toolsizex=2-sw
if toolsizey<1-sh then toolsizey=2-sh
if sprite exist(file1)=1 then size sprite file1,sw+toolsizex,sh+toolsizey
`
if sprite exist(file1)=1 then rotate sprite file1,rotate
if inkey$()="," then dec rotate
if inkey$()="." then inc rotate
if rotate<0 then rotate=360
if rotate>360 then rotate=0
`
until mouseclick()>0
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(file1)=1 then paste sprite file1,mousex(),mousey()
if sprite exist(file1)=1 then delete sprite file1
xsleep(200)
id=0
else id=0
endif
return
endif
`
` open file ... transparent
if id=328
open_transparent_sub:
get image all1,0,0,dw,dh,1
fileO$=openDialog("Open image file","Image File (*.bmp)|*.bmp|Image File (*.jpg)|*.jpg")
if fileO$>""
change mouse 1
load image fileO$,file1
if image exist(file1)=1 then sprite file1,-2000,-2000,file1
if sprite exist(file1)=1 then sw=sprite width(file1) : sh=sprite height(file1)
if sprite exist(file1)=1 then delete sprite file1
if image exist(file1)=1 then paste image file1,0,0
`
fpSelected = point(1,1) : ` get colour of first pixel (fp ha)
pr=rgbr(fpSelected)
pg=rgbg(fpSelected)
pb=rgbb(fpSelected)
`
ink 0,0
`
lock pixels
for t = 0 to sw
for u = 0 to sh
BColSelected = point(t,u)
fr=rgbr(BColSelected)
fg=rgbg(BColSelected)
fb=rgbb(BColSelected)
ink 0,0
if fr>pr-8 and fr<pr+8 and fg>pg-8 and fg<pg+8 and fb>pb-8 and fb<pb+8 then dot t,u
next u
next t
unlock pixels
change mouse 0
get image file2,0,0,sw,sh
repeat
if image exist(all1)=1 then paste image all1,0,0
sprite file1,mousex(),mousey(),file2
if sprite exist(file1)=1 then offset sprite file1,sprite width(file1)/2,sprite height(file1)/2
if upkey()=1 then inc toolsizey,4
if downkey()=1 then dec toolsizey,4
if leftkey()=1 then dec toolsizex,4
if rightkey()=1 then inc toolsizex,4
if toolsizex<1-sw then toolsizex=2-sw
if toolsizey<1-sh then toolsizey=2-sh
if sprite exist(file1)=1 then size sprite file1,sw+toolsizex,sh+toolsizey
`
if sprite exist(file1)=1 then rotate sprite file1,rotate
if inkey$()="," then dec rotate
if inkey$()="." then inc rotate
if rotate<0 then rotate=360
if rotate>360 then rotate=0
`
until mouseclick()>0
`
if image exist(all1)=1 then paste image all1,0,0
if sprite exist(file1)=1 then paste sprite file1,mousex(),mousey()
if sprite exist(file1)=1 then delete sprite file1
xsleep(200)
id=0
else id=0
endif
return
endif
`
` save image file
if id=329
save_sub:
`sync off
fileS$=saveDialog("Save image file","Image File (*.bmp)|*.bmp|Image File (*.jpg)|*.jpg")
question=1
if fileS$>""
get image file1,60,0,dw,dh-25,1
if file exist(fileS$)=1 then question=questionMessage("do you want to over write it?", fileS$ + "exists")
if question=1 then save image fileS$,file1 : xsleep(200) : id=0
else
id=0
`sync on
endif
`sync on
return
endif
`
` save image file selection
if id=330
save_selection_sub:
fileS$=saveDialog("Save selection, image file","Image File (*.bmp)|*.bmp|Image File (*.jpg)|*.jpg")
question=1
if fileS$>""
get image file1,tracex,tracey,tracex1,tracey1,1
if file exist(fileS$)=1 then question=questionMessage("do you want to over write it?", fileS$ + "exists")
if question=1 then save image fileS$,file1 : xsleep(200) : id=0
else
id=0
endif
return
endif
`
` new drawing
if id=331
new_sub:
question=questionMessage("do u want to save b4 you clear?", "warning")
if question=1 then gosub save_sub
`
if question=0 then cls rgb(br,bg,bb)
id=0
return
endif
`
return
`
`
` +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`----------------------------------------- looped functions -----------------------
` **********************************************************************************
`
` old x
function old_x()
oldx_result=mousex()
endfunction (oldx_result)
`
` old y
function old_y()
oldy_result=mousey()
endfunction (oldy_result)
`
`
function no_run()
delete memblock 0
endfunction
`
` thanks to the man for this sleep function
function xsleep(length)
waited=timer()
while timer() < waited+length
endwhile
endfunction
`
`
` data for floater
floater_text:
data "Pencil, use arrowkeys to size","Sketch","Slant, use arrowkeys to size and angle","Duct","Chain, use arrowkeys to size","Spray","Fan","Cross","Polygon, click, click, click.. 'enter' to finish","Shade Fill, hold and move mouse within desired area "
data "Shade Fill Extra","Text click, type .. 'enter' for new line ","Undo","Redo","Select, drag mouse along desired area","Resize","Mirror selected area","Rotate selected area","Canvas","Zoom in on selected area","Zoom back"
data "Paste Full, 'arrowkeys' to size, '<' and '>' to spin","Paste Transparent, 'arrowkeys' to size, '<' and '>' to spin","Erazer","Blur selected area","Buzz selected area","Open","Open Transparent","Save","Save Selection","New"
For now, I hope you try 'Soul'. I've enjoyed making it,(big time).
Blue gui 2 is wonderful.
Even though it's not a game I'd like your comments.
I know there are still bugs here and there, but it's stable.
----------------
And goodnight .... It's so late.
I'll edit this post in the morning..
regards,
miki.
edit1:
I;m trying to work out a bucketfill function, I have been for a month. I've come quite close with 'shade_fill_sub'.
if id=310
shade_fill_sub:
sync on
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if mouseclick()=1
lock pixels
`
x1=mousex():y1=mousey():x2=mousex():y2=mousey()
fcol=point(mousex(),mousey())
fr=rgbr(fcol)
fg=rgbg(fcol)
fb=rgbb(fcol)
stop=0
repeat
`
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir =0 then inc x1 : inc y1
if fill_dir =1 then dec x1 : inc y1
col=point(x1,y1)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
ink rgb(r,g,b),0
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x1,y1 else stop=1
`
until stop=1
stop=0
repeat
if inkey$()="f" then inc fill_dir :xsleep(200)
if fill_dir>1 then fill_dir=0
if fill_dir=0 then dec x2 : dec y2
if fill_dir=1 then inc x2 : dec y2
col=point(x2,y2)
r#=rgbr(col)
g#=rgbg(col)
b#=rgbb(col)
if mouseposx()>50 and r#=fr and g#=fg and b#=fb then dot x2,y2 else stop=1
until stop=1
stop=0
unlock pixels
endif
sync
sync off
return
endif
`
but not close enough.
can anyone help?
in the end