reduce - reduce flashing :D
Author |
Message |
ScribbleS
|
Posted: Sun Nov 16, 2008 6:20 pm Post subject: 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? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Euphoracle
|
Posted: Sun Nov 16, 2008 6:57 pm Post subject: 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
|
Posted: Sun Nov 16, 2008 7:53 pm Post subject: 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.
code: |
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 ) |
|
|
|
|
|
S_Grimm
|
Posted: Sun Nov 16, 2008 8:04 pm Post subject: RE:reduce - reduce flashing :D |
|
|
don't for get it needs to be in a loop |
|
|
|
|
|
Insectoid
|
Posted: Sun Nov 16, 2008 8:14 pm Post subject: RE:reduce - reduce flashing :D |
|
|
Not always, A/V. Usually, but not always. |
|
|
|
|
|
Euphoracle
|
Posted: Mon Nov 17, 2008 6:50 am Post subject: Re: RE:reduce - reduce flashing :D |
|
|
insectoid @ Sun Nov 16, 2008 7:53 pm wrote: 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.
code: |
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 )
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.
code: |
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
|
Posted: Mon Nov 17, 2008 9:46 am Post subject: Re: RE:reduce - reduce flashing :D |
|
|
Euphoracle @ Mon Nov 17, 2008 6:50 am wrote:
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
|
Posted: Mon Nov 17, 2008 11:31 am Post subject: 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. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|