Preloading graphics
BlitzMax Forums/BlitzMax Beginners Area/Preloading graphics
| ||
I´m wondering how i do to preload the graphics for my game correctly, as i do right now i´m creating variables + the loadimage command as i start the game. And then as i play i assign those variables to "image" variables inside my types such as effects and stuff, i guess i don´t want to use the loadimage command inside the game loop, or? what would you recommend? |
| ||
Sounds about right. |
| ||
What Toby said. |
| ||
Yup. The one thing you may want to do though, is first load & display an intro screen, and then load all your additional images -- otherwise you'll be staring at a black screen until it's finished downloading everything first. |
| ||
or show a black screen with a loading bar, that's what I do. |
| ||
Or not go into graphics mode until you're done loading. |
| ||
Or not go into graphics mode until you're done loading. Don't you need to be in a graphics mode to load your graphics? A change (or starting of) a graphics mode will flush any graphics already loaded. Or have I missed something? |
| ||
It doesn't matter any more. Although I have had an odd result. This image:timage=LoadImage("max.png") Graphics 640,480 DrawImage image,0,0 Flip WaitKey() only loads 1/4 of the image. Other images are fine and loading after graphics is fine. Very odd. |
| ||
Yeh I think the images aren't really cleared, but could become corrupt under certain situations... sort of like not relying on the compiler to pass function parameters in any particular order. Loading an image before using a Graphics command is generally not good. Shame on you ducky. |