Computer Science Canada Flickerating Font.Draw |
| Author: | Mr. T [ Wed Apr 06, 2005 7:53 pm ] | ||
| Post subject: | Flickerating Font.Draw | ||
how can i make the madness end?
|
|||
| Author: | Naveg [ Wed Apr 06, 2005 8:05 pm ] |
| Post subject: | |
try putting a View.Update right before every end loop, its the most common place where causes of flickering may happen |
|
| Author: | jamonathin [ Wed Apr 06, 2005 8:13 pm ] |
| Post subject: | |
Changes: - color/colorback moved outside of for loop (no need to be inside) - changed for loop to 0 .. 500 by 5 (no one's going to want to wait that long) - cls goes before the Font.Draw's - View.Set ("offscreenonly") was moved above the calling of the proc. and that about does it for now, i didn't look at the rest of your program though, ask if there's anything wrong with that. |
|
| Author: | jamonathin [ Wed Apr 06, 2005 8:18 pm ] | ||
| Post subject: | |||
Vladimir wrote: try putting a View.Update right before every end loop, its the most common place where causes of flickering may happen
You're going to want to put it after you've drawn everything. In some programs you do use, (do i dare say) processes, but if you were to run a loop in the process and a main loop, and you have one View.Update in the process, and one in the main loop, it's gonna flicker. The easiest thing to do is make a procedure dedicated to drawing everything necessary, such as:
And just put that in your loop. |
|||
| Author: | Mr. T [ Wed Apr 06, 2005 8:26 pm ] | ||
| Post subject: | |||
thnx, got it. New question, look at my code below. I ask the user to input a new price for one of the preset food items. how can make it so that it will also automatically give me 2 values after the decimal place?
|
|||
| Author: | jamonathin [ Wed Apr 06, 2005 8:31 pm ] | ||
| Post subject: | |||
I'm not too too sure, but this is what i have, it works and all, but there's probabily an easier way to do it
|
|||
| Author: | Cervantes [ Thu Apr 07, 2005 3:33 pm ] |
| Post subject: | |
Pwned wrote: how can make it so that it will also automatically give me 2 values after the decimal place?
link Jamonathin: try your code with numb := a three digit number. It seems erealstr's fractionWidth parameter starts at 0 at the beginning of the number, not at the decimal place. |
|
| Author: | Token [ Thu Apr 07, 2005 5:30 pm ] | ||||
| Post subject: | |||||
all that you have to do is change
to
i showed him this on msn but i figured i'd post it just for others who were inturested. |
|||||