
-----------------------------------
saad123abc
Tue Apr 16, 2013 5:22 pm

etch a scetch/paint program help
-----------------------------------
What is it you are trying to achieve?
hi i am trying to embed a pen tip otion by clicking on them 


What is the problem you are having?
i cant seem to figure it out


Describe what you have tried to solve this problem
here is my program so far

var x, y, button : int := 0
var font : int := Font.New ("Times:10")
var font1 : int := Font.New ("Times:20")
var radius : int := 6
var shade : int := black
var boxs : int := 5
var boxs1 : int := 1

%background_______________________________________________________________
 setscreen ("graphics:640;860")
drawfillbox (x - boxs1, y - boxs1, x + boxs1, y + boxs1, green)
drawfillbox (0, 0, 270, 70, darkgrey)
Font.Draw ("pick a color", 50, 60, font, yellow)

drawfillbox (0, 25, 20, 45, 0)
drawfillbox (30, 25, 50, 45, 26)
drawfillbox (60, 25, 80, 45, 22)
drawfillbox (90, 25, 110, 45, black)
drawfillbox (120, 25, 140, 45, 1)
drawfillbox (150, 25, 170, 45, 32)
drawfillbox (180, 25, 200, 45, 53)
drawfillbox (210, 25, 230, 45, 51)
drawfillbox (240, 25, 260, 45, 48)
drawfillbox (0, 0, 20, 20, 2)
drawfillbox (30, 0, 50, 20, 14)
drawfillbox (60, 0, 80, 20, 44)
drawfillbox (90, 0, 110, 20, 43)
drawfillbox (120, 0, 140, 20, 42)
drawfillbox (150, 0, 170, 20, 40)
drawfillbox (180, 0, 200, 20, 38)
drawfillbox (210, 0, 230, 20, 36)
drawfillbox (240, 0, 260, 20, purple)

drawfillbox (360, 0, 460, 50, darkgrey)
Font.Draw ("pick a pen tip", 365, 30, font, yellow)
drawfillbox (372, 2, 392, 22, black)
Draw.FillStar (398, 2, 418, 22, black)
Draw.FillMapleLeaf (420, 2, 440, 22, black)

drawfillbox (470, 0, 550, 50, darkgrey)
Font.Draw ("incr/decr size", 476, 30, font, yellow)
drawfillbox (480, 0, 500, 20, white)
drawline (490, 18, 490, 2, black)
drawline (482, 10, 498, 10, black)
drawfillbox (510, 0, 530, 20, white)
drawline (512, 10, 528, 10, black)

drawfillbox (560, 0, 640, 50, darkgrey)

drawfillbox (565, 1, 634, 41, yellow)
Font.Draw ("exit", 580, 20, font1, black)
%ACTUAL THING_____________________________________________________________
drawfillbox (0, 75, maxx, 755, black)
drawfillbox (0, 80, maxx, 750, white)

loop

    mousewhere (x, y, button)
    if x > 0 and x < maxx and y > 80 and y < maxy and button = 1 then

        if button = 1 then
            drawfillbox (x - boxs, y - boxs, x + boxs, y + boxs, shade)
        end if
    end if
    %color toolbar______________________________________________________________


if x>372 and x0 and y398 and x0 and y 0 and x < 20 and y > 25 and y < 45 and button = 1 then
        shade := 0
    end if

    if x > 30 and x < 50 and y > 25 and y < 45 and button = 1 then
        shade := 26
    end if

    if x > 60 and x < 80 and y > 25 and y < 45 and button = 1 then
        shade := 22
    end if

    if x > 90 and x < 110 and y > 25 and y < 45 and button = 1 then
        shade := black
    end if
    if x > 120 and x < 140 and y > 25 and y < 45 and button = 1 then
        shade := 1
    end if
    if x > 150 and x < 170 and y > 25 and y < 45 and button = 1 then
        shade := 32
    end if

    if x > 180 and x < 200 and y > 25 and y < 45 and button = 1 then
        shade := 53
    end if
    if x > 210 and x < 230 and y > 25 and y < 45 and button = 1 then
        shade := 51
    end if
    if x > 240 and x < 260 and y > 25 and y < 45 and button = 1 then
        shade := 48
    end if

        if x > 0 and x < 20 and y > 0 and y < 20 and button = 1 then
        shade := 2
    end if

    if x > 30 and x < 50 and y > 0 and y < 20 and button = 1 then
        shade := 14
    end if

    if x > 60 and x < 80 and y > 0 and y < 20 and button = 1 then
        shade := 44
    end if

    if x > 90 and x < 110 and y > 0 and y < 20 and button = 1 then
        shade := 43
    end if
    if x > 120 and x < 140 and y > 0 and y < 20 and button = 1 then
        shade := 42
    end if
    if x > 150 and x < 170 and y > 0 and y < 20 and button = 1 then
        shade := 40
    end if
    if x > 180 and x < 200 and y > 0 and y < 20 and button = 1 then
        shade := 38
    end if
    if x > 210 and x < 230 and y > 0 and y < 20 and button = 1 then
        shade := 36
    end if
    if x > 240 and x < 260 and y > 0 and y < 20 and button = 1 then
        shade := purple
    end if

    
    
    if x > 470 and x < 490 and y > 1 and y < 21 and button = 1 then
        shade := 0
        boxs1 := 18
    end if
    if x > 500 and x < 510 and y > 1 and y < 11 and button = 1 then
        shade := 0
        boxs1 := 8
    end if
    if x > 520 and x < 525 and y > 1 and y < 6 and button = 1 then
        shade := 0
        boxs1 := 3
    end if

end loop




Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using

