Loading an LOD Image in FlxSprite #3438
Replies: 1 comment
-
In advent I used an asset library with preload set to false: https://github.com/Geokureli/Advent2020/blob/master/Project.xml#L74 Since this project we've added FlxG.assets, perhaps we could add some helpers for this. As for whether it's possible to load a smaller version of an image at runtime without loading the whole image, I don't see a way to make that possible, I would make a build script or a macro that generates thumbnails for you with some helpful naming scheme |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a photo gallery in my game in which there's a list of photos you can scroll through, and when you click on one, it opens a substate that shows the image fit to the screensize.

However, the gallery is...
big... also, it's probably not even done getting filled yet. This leads to some issues.
I tried loading all the images in at once, but the game freezes for like a good chunk of time during state loading which isn't great. To fix this, I tried a second approach, in which images load as they become visible, but this means that scrolling through the photo gallery is a lagfest the whole way and terribly affects performance. Not to mention that if you scroll quickly enough, you can see the photos become unloaded and reloaded, which I would say is worse.
Then I had a thought: what if there was a way to load LOD versions of images in FlxSprites
I couldn't find a method, but I'm wondering if this would be possible? To load lower quality "thumbnails" of images into an FlxSprite?
Beta Was this translation helpful? Give feedback.
All reactions