If your have to display images in your mod that are not included in the mod file (for example for reducing the size of the mod or for showing user-generated content), you can use geode’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/geode-sdk/docs/llms.txt
Use this file to discover all available pages before exploring further.
LazySprite class. It can also be used for ordinary image initialization, either from a path or from raw data, which would have slight performance improvements over CCSprite::create, as the image is lazily read and decoded in the background, without freezing the game.
It is recommended to use this API instead of implementing custom solutions that mess with CCTextureCache. It is not straightforward to do this correctly, and multiple mods (and Geode itself) have in the past failed to do this without memory leaks and other bugs.
By default, the sprite will have a loading circle inside it when it’s loading, which is removed once loading is finished. This can be disabled, making the sprite blank until it’s loaded.
Usage
Basic examples of downloading an image from a URL, loading from a file, and initializing from data, and a showcase of various options.Automatic resize
Once the sprite has finished loading, the content size of theLazySprite will be set to match the loaded image (in the same manner a CCSprite::initWithTexture would). If you want the sprite to be automatically scaled to the size you passed in LazySprite::create, you can enable autoresize:
Caching
By default, if usingloadFromFile or loadFromUrl, this class will cache the textures in CCTextureCache (loadFromData is not supported due to it being hard to pick a uniquely identifying cache key).
If this is not wanted, the load functions have an extra bool argument for ignoring the cache: