Painter

Post Reply
User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Painter

Post 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
Attachments
painter.txt
(1.12 KiB) Downloaded 318 times

Logikmensch
Posts: 17
Joined: Wed Aug 21, 2013 8:02 am

Re: Painter

Post by Logikmensch »

very nice program. it demonstrates how easy it is to create good applications with your Basic!

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Painter

Post by Mr. Kibernetik »

Logikmensch wrote:very nice program. it demonstrates how easy it is to create good applications with your Basic!
Thank you! :)

Post Reply