Gui Images optimization
by Eyal Erez · in iTorque 2D · 12/09/2008 (5:25 pm) · 3 replies
I have a few questions that could potentially help us minimize our loading time and memory issues too.
1. Since gui images are not part of the datablocks.cs, how do we get any info on them? .... like the info we get from $pref::2TD::imageMapShowPacking .
2. do we have any control over the filtering/padding/allowUnload etc... ?
3. Are gui images get uploaded to memory when the .gui script is executed or when we call the gui via Canvas methods (setContent/pushDialog)?
1. Since gui images are not part of the datablocks.cs, how do we get any info on them? .... like the info we get from $pref::2TD::imageMapShowPacking .
2. do we have any control over the filtering/padding/allowUnload etc... ?
3. Are gui images get uploaded to memory when the .gui script is executed or when we call the gui via Canvas methods (setContent/pushDialog)?
#2
There is definitely filtering on the gui Images, altough I've no idea if they are padded or not and if it matters at all in terms of memory.
Anyway, my biggest concern is actually question #3. right now I'm executing all the .gui files when the game starts and I do have quite a few guis with images, some of them you never even get to see unless you finish the game like the gameOver.gui so I can easily postponed the exec till I actually need the gui if it'l make any difference.
I also have many gui's that are using the same background image and so I'm really hoping that the image is loaded once and being shared for all the gui's. I'm also hoping that when I popDialog or setContent out of the gui, these images can be removed from Memory. a good example is the splash screen that you only need to see once, when the game starts and can be removed right after.
Anyway, it would have been nice to have some control over it, or at least knowledge of how it actually works.
12/09/2008 (9:13 pm)
Yes, I didn't think there is any way to get this info.There is definitely filtering on the gui Images, altough I've no idea if they are padded or not and if it matters at all in terms of memory.
Anyway, my biggest concern is actually question #3. right now I'm executing all the .gui files when the game starts and I do have quite a few guis with images, some of them you never even get to see unless you finish the game like the gameOver.gui so I can easily postponed the exec till I actually need the gui if it'l make any difference.
I also have many gui's that are using the same background image and so I'm really hoping that the image is loaded once and being shared for all the gui's. I'm also hoping that when I popDialog or setContent out of the gui, these images can be removed from Memory. a good example is the splash screen that you only need to see once, when the game starts and can be removed right after.
Anyway, it would have been nice to have some control over it, or at least knowledge of how it actually works.
#3
Thanks for this post,
Yes, I'd also like to know if gui images get removed from memory when the dialog is popped.
Surely deleting the actual gui from memory will cause it to delete it's images from memory correct?
Based on that assumption I'm currently using the:
'exec("somegui.gui"); right before the gui is needed and
SomeGui.delete(); When it's no longer being shown' approach.
Is that enough to keep it's images out of memory when they are not being used?
06/26/2009 (4:49 pm)
Thanks for this post,
Yes, I'd also like to know if gui images get removed from memory when the dialog is popped.
Surely deleting the actual gui from memory will cause it to delete it's images from memory correct?
Based on that assumption I'm currently using the:
'exec("somegui.gui"); right before the gui is needed and
SomeGui.delete(); When it's no longer being shown' approach.
Is that enough to keep it's images out of memory when they are not being used?
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
2. See 1