wouldnt it be easier to make a .gif or a .avi and then render that as a texture onto a sprite that is the same size as the screen (or whatever size you need)
that way you can do things like dynamic resizing, layering, alpha transperiencies... etc... etc... etc...
Why do you need to load 200 images and how big are they ? I can't think of a reason why you would need this, the best way is to load each as necessary (ie: if in a game env't then load necessary imgs for each level)
1. code please
2. use timers and load a new image when timer:time()>timelimit
3. don't load all images before the loop, the psp doesn't have that much resources
4. unassign the old picture when the new one is blitted
5. oldpic=""
No need to unassign anything in Lua. Use the same variable name for a new value of *any* type. Lua has a built-in garbage collector to take care of cleaning up inside.
Yeah i was wondering how that works. It doesn't clean it up when you use another variable, right? Because if i do that and i don't empty the old var. myself, it crashes if i do that a couple of times.
All global non-nil variables can be left untouched in the namespace. It has been advised to declare all variables as locals if possible since they can be garbage-collected sooner or later automatically.
The crash sounds like a memory error, try freeing up images as you display them and dont load them all up at once. That could possibly be your biggest issue.
romero126 wrote:The crash sounds like a memory error, try freeing up images as you display them and dont load them all up at once. That could possibly be your biggest issue.
Yeah thats what i figured. I clear the images, but it crashes always (if it crashes) at the moment it loads four 1000x1000 images after eachother. However it doesn't crash alot anymore, since i clear the unused images. I guess i dont clear everything. I'll look for more stuff i can kick out of the memory.
I have heard that LuaPlayer can load 1000x1000 jpgs, but I havent tried it out.
I was helping someone out with code today, and the same thing happened. For some reason, a 480x272 image takes up exactly 1mb RAM. Now, with Lowser, Lua has only 16mb to use.
As for how to remove images, you should.
theimage = nil
collectgarbage()
that will remove the image from memory then garbage collect to rid of it forever.
Ok im getting a little tired of this. How about you guys try something out yourself first. Im using a 1000x1000 JPG image of 58 kB and it works. It wont work with PNG but it does with JPG. And yoursam I was the one who told you this remember?