https://github.com/user95401/geode-gif-sprites-api
Adds support for animated gif files in CCSprite::create(), returns CCGIFAnimatedSprite.
https://github.com/user95401/geode-gif-sprites-api
Last synced: 11 months ago
JSON representation
Adds support for animated gif files in CCSprite::create(), returns CCGIFAnimatedSprite.
- Host: GitHub
- URL: https://github.com/user95401/geode-gif-sprites-api
- Owner: user95401
- License: mit
- Created: 2025-05-10T10:57:08.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-17T19:03:32.000Z (about 1 year ago)
- Last Synced: 2025-06-17T20:18:22.259Z (about 1 year ago)
- Language: C
- Homepage: https://geode-sdk.org/mods/user95401.gif-sprites
- Size: 825 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# GIF Sprites
Adds support for animated **GIF** files in `CCSprite::create()` for Geometry Dash using **giflib** v5.0.0!
## Usage
If the filename ends with `.gif` or header is `GIF87a` or `GIF89a` (you can use gif file named as `anim.png`), a `CCGIFAnimatedSprite` will be returned instead of a `CCSprite`.
The animation plays automatically and uses embedded frame delays.
```cpp
auto gif = CCSprite::create("animated.gif"); //returns CCGIFAnimatedSprite*
gif->setPosition(this->getContentSize() / 2);
this->addChild(gif, 10);
```
Or if you included ``:
```cpp
#include
auto gif = CCGIFAnimatedSprite::create("animated.gif");
gif->setPosition(this->getContentSize() / 2);
this->addChild(gif, 10);
//mbo stuff
gif->play();
gif->pause();
gif->stop();
gif->setLoop(false);
bool playing = gif->isPlaying();
auto filename = gif->m_filename; //str
```
Using texture pack (or any other resource modding ways) you can replace some files like `GJ_gradientBG.png`, just rename your `epic-anime-wallpaper.gif` exactly to `GJ_gradientBG.png`, mod detect it as long as this file is GIF87a or GIF89a.
## Features
- Hooks `CCSprite::create(const char*)` to support creating animated sprites from GIF file.
- Frame decoding with correct delays
- Automatic animation loop
- Shared caching on repeated loads
- Lightweight and early-load safe
## Integration
Add to your `mod.json` dependencies:
```json
"dependencies": {
"user95401.gif-sprites": ">=v2.0.0"
}
```
And include headers (optional):
```cpp
#include
```