Sprite Frames Unity
Developer Utility for dynamically merging mod sprites into existing game textures.
How it works
This mod hooks into Cocos2D's CCSpriteFrameCache::addSpriteFramesWithFile to intercept when mods load their .plist files. When a mod tries to load sprites from a subdirectory (like mod_name/spritesheet.plist), it:
- Detects the target texture - Looks for the base game texture that should receive new sprites
- Creates a render canvas - Uses CCRenderTexture to composite the original texture with mod sprites
- Merges textures in real-time - Combines sprites while preserving original layout and quality
- Updates sprite frame coordinates - Recalculates UV coordinates for the merged texture
- Replaces texture data - Swaps the original texture with the merged version
Technical Benefits
- No file replacement - Original game files remain untouched
- Multiple mod support - Multiple mods can add sprites to the same texture
- Preserves quality - Maintains texture parameters and formats
For Mod Developers
Perfect for mods that need to add content to existing spritesheets like:
- Custom game objects in GJ_GameSheet or GJ_GameSheet02
- Additional UI elements in GJ_GameSheet03 (yea, there is batchnoded stuff too)
Add to your mod.json the dependencies:
"dependencies": {
"user95401.sprite-frames-unity": ">=v1.0.0"
}
Live usage example on dialog trigger mod.
Note: end users need mods that utilize this system to see changes.