Computer Science Canada summative |
Author: | gh0stz [ Mon May 29, 2006 6:09 pm ] | ||
Post subject: | summative | ||
i have a school summative where i have make an electronical catalogue. is there a way for me to use the gui (menu bar) and put a picture in? From what i have tried it doesn't work.
thats what i have so far, please help |
Author: | Delos [ Mon May 29, 2006 6:24 pm ] | ||
Post subject: | |||
Hello. In future, please use more descriptive topic titles that "summative". This tells us nothing about the nature of your problem and hence fewer people will be interested in looking at your thread. It's for your own benefit, really. I'm not entirely sure I understood your question, as it was a little vaguely phrased (mind you, not as bad as they get). Am I to believe that you want to be able to access GUI objects while at the same time drawing pictures where necassary? Perhaps background pics or the like? This is quite possible. Keep in mind that your final loop will contain GUI.ProcessEvent, and essentially that is an infinite loop that will only terminate when GUI.Quit is called. Therefore, any other sorts of things that you feel like doing should be done before that loop, or in some cases, in that loop itself.
If that didn't answer your question, be a little more specific and we'll see what we can do. |
Author: | gh0stz [ Mon May 29, 2006 7:20 pm ] | ||
Post subject: | |||
note taken delos ![]() but i'm not quite understanding the concept behind the second part of your code that goes
what does the current_time:= Time.Elasped do? basically.. i don't understand the whole second thing or how to impliment delay_factor or current_time. thanks for your help so far |
Author: | HellblazerX [ Mon May 29, 2006 8:59 pm ] |
Post subject: | |
It's a fps (frames per second) limiter. Basically, it makes it so the image is only drawn at certain time intervals, rather than everytime the program loops. Like for example, in his code, if you set the variable delay_factor to 500, it will draw the images every 500 milliseconds, or draws twice every second, and thus you get 2 fps. What the Time.Elapsed function does is it returns the number of milliseconds that has passed since the program began. In his code, Delos keeps track of the time he drew the image last time, and when the time interval is up, he draws the image again, and saves the time, and so on and so on. Btw, Delos, you don't need the currentTime := Time.Elapsed seeing as you're only calling it once. You can have the Time.Elapsed inside the if statement. Also, it's more accurate this way because there is that tiny portion of time it takes to read the next line. ![]() |