Page 1 of 1

Painter

Posted: Thu Sep 05, 2013 5:19 am
by Mr. Kibernetik
You can copy code from here or download attached file:

Code: Select all

graphics
graphics clear 1,1,1
r=10
r2=r*2
draw size r2
new=1
set buttons default
button "clear" title "Clear" at 10,10 size 70,40
set buttons custom
fill color 0,0,0
draw color 1,1,1
button "black" title "Black" at 10,60 size 70,30
fill color 1,1,1
draw color 0,0,0
button "white" title "White" at 10,100 size 70,30
fill color 1,0,0
draw color 1,1,1
button "red" title "Red" at 10,140 size 70,30
fill color 0,1,0
button "green" title "Green" at 10,180 size 70,30
fill color 0,0,1
button "blue" title "Blue" at 10,220 size 70,30
draw color 0,0,0
fill color 0,0,0
loop:get touch 0 as x,y
if x=-1 then
new=1
if button_pressed("clear") then graphics clear 1,1,1
if button_pressed("black") then ! draw color 0,0,0 ! fill color 0,0,0 ! endif
if button_pressed("white") then ! draw color 1,1,1 ! fill color 1,1,1 ! endif
if button_pressed("red") then ! draw color 1,0,0 ! fill color 1,0,0 ! endif
if button_pressed("green") then ! draw color 0,1,0 ! fill color 0,1,0 ! endif
if button_pressed("blue") then ! draw color 0,0,1 ! fill color 0,0,1 ! endif
goto loop
endif
if new then draw to x,y else draw line to x,y
fill circle x,y size r
new=0
goto loop

Re: Painter

Posted: Fri Sep 06, 2013 4:59 pm
by Logikmensch
very nice program. it demonstrates how easy it is to create good applications with your Basic!

Re: Painter

Posted: Fri Sep 06, 2013 5:11 pm
by Mr. Kibernetik
Logikmensch wrote:very nice program. it demonstrates how easy it is to create good applications with your Basic!
Thank you! :)