Unload Textures #1270
Answered
by
AlmasB
Fremensito
asked this question in
Q&A
Unload Textures
#1270
-
If I have levels like lv 1 and lv 2 maps and each one of them uses different textures, how can I get rid of lv 1 textures when I enter the lv 2 map. If I understood correctly the FXGL.getAssetLoader().loadTexture() loads an asset, but will it stay in the memory when I pass to the next lvls and won't use the previous lvls asset anymore? |
Beta Was this translation helpful? Give feedback.
Answered by
AlmasB
Apr 24, 2023
Replies: 1 comment
-
If you wish to free resources related to images, then you can:
The memory associated with the image should then be freed on the next GC call. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Fremensito
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you wish to free resources related to images, then you can:
FXGL.getAssetLoader().clearCache()
texture.dispose()
The memory associated with the image should then be freed on the next GC call.