Paint program project. Anybody extends this start snippet?

Post Reply
Henko
Posts: 821
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Paint program project. Anybody extends this start snippet?

Post by Henko »

graphics
graphics clear .8,.8,.8
draw size 3 ! draw color 0,0,0
button "cls" title "clear" at 310,900 size 70,50
button "pen1" title "thin" at 10,920 size 90,30
button "pen2" title "medium" at 110,920 size 90,30
button "pen3" title "thick" at 210,920 size 90,30
button "black" title "black" at 390,920 size 90,30
button "red" title "red" at 490,920 size 90,30
button "green" title "green" at 590,920 size 90,30
button "blue" title "blue" at 690,920 size 70,30

loop1:
if button_pressed("cls")   then graphics clear .8,.8,.8
if button_pressed("pen1")  then draw size 1
if button_pressed("pen2")  then draw size 3
if button_pressed("pen3")  then draw size 6
if button_pressed("black") then draw color 0,0,0
if button_pressed("red")   then draw color 1,0,0
if button_pressed("green") then draw color 0,1,0
if button_pressed("blue")  then draw color 0,0,1

x=touch_x(0)
if x=-1 then
  up=0 ! goto loop1
  end if
y=touch_y(0) ! if y=-1 then loop1
if up=0 then
  up=1 ! draw to x,y ! goto loop1
  end if
draw line to x,y
goto loop1

Post Reply