
-----------------------------------
ScribbleS
Sun Nov 16, 2008 6:20 pm

reduce - reduce flashing :D
-----------------------------------
hi. i'm back with questions again. xD
i'm doing something with animation, and i've already tried to use View.Set ("offscreenonly") to stop the screen from flickering so much, but because the program draws two graphics per cls, its still flashing quite violently. at this rate i might be blind before i can attempt at finishing anything....@_@
anyone has any tips to help my poor bleeding eyes?   :?:

-----------------------------------
Euphoracle
Sun Nov 16, 2008 6:57 pm

RE:reduce - reduce flashing :D
-----------------------------------
setscreen("offscreenonly") at the top, 

View.Update() after you've drawn everything.  There's nothing else you can do.  Don't call View.Update more than once at the end.

-----------------------------------
Insectoid
Sun Nov 16, 2008 7:53 pm

RE:reduce - reduce flashing :D
-----------------------------------
If you use View.Update after every draw, it will essentially undo the 'offscreenonly'. The key is one per group of graphics. So, one right before every delay/cls is the norm. 


View.Set ("offscreenonly")
Draw.Oval (blah, blooh, blah, blee, blah)
Draw.FillLightBulb (scribblescribblescribble)
View.Update
delay (10)
cls


This is what it should look like. (well....sort of...don't copy my code :P)

-----------------------------------
S_Grimm
Sun Nov 16, 2008 8:04 pm

RE:reduce - reduce flashing :D
-----------------------------------
don't for get it needs to be in a loop

-----------------------------------
Insectoid
Sun Nov 16, 2008 8:14 pm

RE:reduce - reduce flashing :D
-----------------------------------
Not always, A/V. Usually, but not always.

-----------------------------------
Euphoracle
Mon Nov 17, 2008 6:50 am

Re: RE:reduce - reduce flashing :D
-----------------------------------
If you use View.Update after every draw, it will essentially undo the 'offscreenonly'. The key is one per group of graphics. So, one right before every delay/cls is the norm. 


View.Set ("offscreenonly")
Draw.Oval (blah, blooh, blah, blee, blah)
Draw.FillLightBulb (scribblescribblescribble)
View.Update
delay (10)
cls


This is what it should look like. (well....sort of...don't copy my code :P)

You should be doing the cls first.  You don't want to have a blank screen for a fraction of a second when you're redrawing everything.  That undoes the effect.


View.Set ("offscreenonly")
loop
    cls
    Draw.Oval (blah, blooh, blah, blee, blah)
    Draw.FillLightBulb (scribblescribblescribble)
    View.Update
end loop


And unnecessary delays are silly.

-----------------------------------
HellblazerX
Mon Nov 17, 2008 9:46 am

Re: RE:reduce - reduce flashing :D
-----------------------------------

You should be doing the cls first.  You don't want to have a blank screen for a fraction of a second when you're redrawing everything.  That undoes the effect.
I'm pretty sure that wouldn't really matter, especially in a loop, and especially since you're using a double buffer.  The only place your cls shouldn't be is between your draw commands and your View.Update.

-----------------------------------
S_Grimm
Mon Nov 17, 2008 11:31 am

RE:reduce - reduce flashing :D
-----------------------------------
You can put the cls wherever, but it will not look right in between draw commands and View.Update. Before the draw commands is usually a good idea, so that there is no image left at the start of the loop. 

And the dely might be there on purpose. Maybe for effect.

And insectoid, any program where you need to constantly update the position of a drawn object needs to be in a loop.
