
-----------------------------------
Thuged_Out_G
Fri Dec 12, 2003 4:51 pm

Fade effect?
-----------------------------------
i wanted to make a sonar like thing

here is what i have so far, its not much lol


View.Set ("graphics")
for decreasing i : maxint .. 1
    Draw.FillArc (100, 100, 100, 100, 0, 360, black)
    Draw.FillArc (100, 100, 100, 100, i - 1, i, 10)
    delay(15)
end for


i was wondering how i could add like a fade effect to the green bar

any ideas anyone?

-----------------------------------
Mazer
Fri Dec 12, 2003 5:33 pm


-----------------------------------
with turing, you start off with a pretty crappy (for most things) palette of 256 colours. if you plan on drawing with any other colours you're either loading pictures, or making your own colours. luckily there's a way to make your own colours in turing: RGB.SetColour(). it takes 4 parameters: colour number, red component, green component, and blue component. using this you can mix your own colours by using various values of red green and blue (between 0.0 and 1.0, see 
var angle := 0

for i : 0 .. 255
    RGB.SetColour (i, 0, (i - 150) / 150 * i / 255, 0)
end for
RGB.SetColour (255, 0, .8, 0)
RGB.SetColour (0, 0, 0, 0)
cls

View.Set ("offscreenonly")
loop
    angle += 5
    for decreasing c : 255 .. 170
        Draw.FillArc (100, 100, 100, 100, angle + c, angle + c + 1, c)
        drawfillarc (100, 100, 100, 100, angle + 255, angle + 257, 255)
    end for
    View.Update
    delay (20)
    drawfilloval (100, 100, 100, 100, 170)
end loop


-----------------------------------
DanShadow
Fri Dec 12, 2003 5:41 pm


-----------------------------------
Ah! RGB is the answer to not using the 256 colors...ive been secretly wondering about that for a couple weeks, tx! 
Also, that sonar looks great.  :D

-----------------------------------
Homer_simpson
Fri Dec 12, 2003 6:44 pm


-----------------------------------
mazer yer effect is pretty creative i like it... + bits

-----------------------------------
Thuged_Out_G
Fri Dec 12, 2003 7:38 pm


-----------------------------------
thanks mazer, that was a pretty cool solution...im gonna try it on my own now :D

-----------------------------------
Thuged_Out_G
Fri Dec 12, 2003 7:50 pm


-----------------------------------
i have another question
i made the sonar bleep things to appear where the user clicks the mouse, and i am trying to make it so the bleeps are black when the user clicks outside the sonar....it works, but as soon as you click on the sonar area, and then outside it draws a green bleep 


var angle := 0
var x, y, button : int

for i : 0 .. 255
    RGB.SetColour (i, 0, (i - 150) / 150 * i / 255, 0)
end for
RGB.SetColour (255, 0, .8, 0)
RGB.SetColour (0, 0, 0, 0)
cls

View.Set ("offscreenonly")
loop
    angle += 5
    for decreasing c : 255 .. 170
        Draw.FillArc (100, 100, 100, 100, angle + c, angle + c + 1, c)
        drawfillarc (100, 100, 100, 100, angle + 255, angle + 257, 255)
    end for
    View.Update
    delay (20)
    drawfilloval (100, 100, 100, 100, 170)
    Mouse.Where (x, y, button)
    if button = 1 then
        if x  > angle and y > angle then
            Draw.Oval (x, y, 5, 5, 0)
        else
            Draw.Oval (x, y, 5, 5, 10)
            Draw.Oval (x, y, 10, 10, 10)
        end if
    end if
end loop


any suggestions?

-----------------------------------
Mazer
Fri Dec 12, 2003 8:38 pm


-----------------------------------
that's because the only part of the screen that's being drawn over is the radar part. anything that's drawn somewhere else will stay there until something else is drawn over it or the screen is cleared. try this:

var angle := 0
var x, y, button : int

for i : 0 .. 255
    RGB.SetColour (i, 0, (i - 150) / 150 * i / 255, 0)
end for
RGB.SetColour (255, 0, .8, 0)
RGB.SetColour (0, 0, 0, 0)
cls

View.Set ("offscreenonly")
loop
    angle += 5
    for decreasing c : 255 .. 170
        Draw.FillArc (100, 100, 100, 100, angle + c, angle + c + 1, c)
        drawfillarc (100, 100, 100, 100, angle + 255, angle + 257, 255)
    end for
    Mouse.Where (x, y, button)
    if button = 1 then
        /*
         if x > angle and y > angle then %