[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75KTSD0EB3YD7VANW76A7V0":3,"skill-same:01M75KTSD0EB3YD7VANW76A7V0":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M75KTSD0EB3YD7VANW76A7V0","sprite-sheet",null,"javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkjaylee\u002Fsprite-sheet\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"# Sprite Sheet & Texture Atlas Mastery\n\n**Category**: Game Development | Asset Optimization  \n**Tech Stack**: Rust (Macroquad, Bevy), Godot 4.x  \n**Created**: 2026-02-06  \n**Status**: ✅ Complete\n\n---\n\n## 📋 Overview\n\nSprite sheets (texture atlases) are essential for efficient game asset management, reducing draw calls, memory usage, and load times by packing multiple sprites into a single texture.\n\n### Key Benefits\n- **Performance**: 1 HTTP request instead of N (web games)\n- **Memory**: Reduced texture swaps, better GPU cache utilization\n- **Mobile**: Lower bandwidth consumption, faster loading\n- **Batching**: Multiple sprites rendered in single draw call\n\n---\n\n## 🎯 Core Concepts\n\n### Sprite Sheet vs Texture Atlas\n- **Sprite Sheet**: Uniformly-sized frames (e.g., 16×16 grid for animations)\n- **Texture Atlas**: Irregular shapes packed efficiently (arbitrary sizes)\n- **Practical**: Terms often used interchangeably\n\n### Anatomy\n```\nsprite-sheet.png (2048×2048)\n├─ player_idle_01 (0, 0, 64, 64)\n├─ player_run_01  (64, 0, 64, 64)\n├─ enemy_walk_01  (128, 0, 32, 32)\n└─ ... (metadata in JSON\u002FXML)\n```\n\n**Components**:\n1. **Texture**: The actual PNG\u002FJPG image\n2. **Atlas Metadata**: JSON\u002FXML with frame coordinates\n3. **Animation Data**: Frame sequences, durations\n\n---\n\n## 🛠️ Framework Implementations\n\n### 1. Rust + Macroquad (WASM-Ready)\n\n**Loading**:\n```rust\nuse macroquad::prelude::*;\n\n#[derive(Clone, Copy)]\nstruct SpriteFrame {\n    x: f32, y: f32, w: f32, h: f32,\n}\n\nimpl SpriteFrame {\n    fn as_rect(&self) -> Rect {\n        Rect::new(self.x, self.y, self.w, self.h)\n    }\n}\n\n#[macroquad::main(\"Sprite Demo\")]\nasync fn main() {\n    let texture = load_texture(\"assets\u002Fspritesheet.png\").await.unwrap();\n    texture.set_filter(FilterMode::Nearest); \u002F\u002F Pixel art\n    \n    let frames = vec![\n        SpriteFrame { x: 0.0, y: 0.0, w: 64.0, h: 64.0 },\n        SpriteFrame { x: 64.0, y: 0.0, w: 64.0, h: 64.0 },\n    ];\n    \n    let mut frame_idx = 0;\n    let mut timer = 0.0;\n    \n    loop {\n        clear_background(BLACK);\n        \n        \u002F\u002F Animation logic\n        timer += get_frame_time();\n        if timer > 0.1 {\n            frame_idx = (frame_idx + 1) % frames.len();\n            timer = 0.0;\n        }\n        \n        \u002F\u002F Draw specific frame\n        let frame = frames[frame_idx];\n        draw_texture_ex(\n            &texture,\n            100.0, 100.0, \u002F\u002F destination\n            WHITE,\n            DrawTextureParams {\n                source: Some(frame.as_rect()),\n                dest_size: Some(vec2(128.0, 128.0)), \u002F\u002F scale 2x\n                ..Default::default()\n            },\n        );\n        \n        next_frame().await\n    }\n}\n```\n\n**Key Points**:\n- Use `source` parameter in `DrawTextureParams` for sub-rectangle\n- `FilterMode::Nearest` for pixel art, `Linear` for smooth sprites\n- Store atlas data in const arrays or load JSON with `serde`\n\n---\n\n### 2. Rust + Bevy (ECS Architecture)\n\n**Setup**:\n```rust\nuse bevy::prelude::*;\n\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) \u002F\u002F pixel art\n        .add_systems(Startup, setup)\n        .add_systems(Update, animate_sprite)\n        .run();\n}\n\nfn setup(\n    mut commands: Commands,\n    asset_server: Res\u003CAssetServer>,\n    mut texture_atlases: ResMut\u003CAssets\u003CTextureAtlasLayout>>,\n) {\n    commands.spawn(Camera2dBundle::default());\n    \n    let texture = asset_server.load(\"sprites\u002Fcharacter.png\");\n    \n    \u002F\u002F Define atlas layout (8 columns, 4 rows, each 64×64)\n    let layout = TextureAtlasLayout::from_grid(\n        UVec2::new(64, 64),\n        8, 4,\n        Some(UVec2::new(2, 2)), \u002F\u002F padding\n        Some(UVec2::new(4, 4)), \u002F\u002F offset\n    );\n    let atlas_layout = texture_atlases.add(layout);\n    \n    \u002F\u002F Spawn entity with atlas\n    commands.spawn((\n        SpriteBundle {\n            texture,\n            transform: Transform::from_scale(Vec3::splat(2.0)),\n            ..default()\n        },\n        TextureAtlas {\n            layout: atlas_layout,\n            index: 0,\n        },\n        AnimationTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),\n    ));\n}\n\n#[derive(Component)]\nstruct AnimationTimer(Timer);\n\nfn animate_sprite(\n    time: Res\u003CTime>,\n    mut query: Query\u003C(&mut AnimationTimer, &mut TextureAtlas)>,\n) {\n    for (mut timer, mut atlas) in &mut query {\n        timer.0.tick(time.delta());\n        if timer.0.just_finished() {\n            atlas.index = (atlas.index + 1) % 8; \u002F\u002F 8 frames loop\n        }\n    }\n}\n```\n\n**Key Points**:\n- `TextureAtlasLayout` defines grid or custom rectangles\n- `TextureAtlas` component stores current frame index\n- Use `Timer` for frame-based animation\n- Bevy 0.15+ uses separate layout\u002Fatlas pattern\n\n---\n\n### 3. Godot 4.x (Built-in Atlas Support)\n\n**Method A: AtlasTexture (Editor)**:\n1. Import sprite sheet PNG\n2. Create **AtlasTexture** resource\n3. Set `atlas` to your PNG\n4. Define `region` (x, y, w, h)\n5. Assign to Sprite2D node\n\n**Method B: AnimatedSprite2D**:\n```gdscript\n# res:\u002F\u002Fplayer.gd\nextends AnimatedSprite2D\n\nfunc _ready():\n    # Load sprite frames resource (created in editor)\n    sprite_frames = load(\"res:\u002F\u002Fassets\u002Fplayer_frames.tres\")\n    animation = \"idle\"\n    play()\n\n# player_frames.tres setup:\n# 1. Create SpriteFrames resource\n# 2. Add animation \"idle\"\n# 3. Import frames from atlas with \"Add Frames from Sprite Sheet\"\n# 4. Specify H\u002FV frames or custom regions\n```\n\n**Method C: Code-based Atlas** (GDScript):\n```gdscript\nextends Sprite2D\n\nvar atlas_texture: Texture2D\nvar frames: Array = [\n    Rect2(0, 0, 64, 64),\n    Rect2(64, 0, 64, 64),\n    Rect2(128, 0, 64, 64),\n]\nvar current_frame := 0\nvar timer := 0.0\n\nfunc _ready():\n    atlas_texture = load(\"res:\u002F\u002Fassets\u002Fspritesheet.png\")\n    texture = atlas_texture\n\nfunc _process(delta):\n    timer += delta\n    if timer > 0.1:\n        current_frame = (current_frame + 1) % frames.size()\n        region_enabled = true\n        region_rect = frames[current_frame]\n        timer = 0.0\n```\n\n**Key Points**:\n- Use `AnimatedSprite2D` for most cases (editor-friendly)\n- `region_enabled` + `region_rect` for manual control\n- Import settings: **Texture → 2D Pixels** for pixel art\n\n---\n\n## 🎨 Sprite Sheet Creation Tools\n\n| Tool | Platform | Price | Best For | Export Formats |\n|------|----------|-------|----------|----------------|\n| **TexturePacker** | Win\u002FMac\u002FLinux | Free\u002F$40 | Professional workflows | JSON, XML, Cocos2d, Phaser, Unity |\n| **Aseprite** | Win\u002FMac\u002FLinux | $20 | Pixel art animation | JSON, PNG strips |\n| **Free Texture Packer** | Web | Free | Quick web projects | JSON, CSS |\n| **ShoeBox** | Adobe AIR | Free | Batch processing | Custom XML\u002FJSON |\n| **Kenney Asset Studio** | Win\u002FMac\u002FLinux | Free | Kenney.nl assets only | PNG, JSON |\n| **Godot Editor** | Built-in | Free | Godot projects | .tres (SpriteFrames) |\n\n### Recommended Workflow\n1. **For Kenney.nl Assets**: Use as-is (already optimized) or Kenney Asset Studio\n2. **For Custom Pixel Art**: Aseprite → export sprite sheet with JSON\n3. **For Unity Asset Store Sprites**: Manual extraction (see below)\n4. **For Production**: TexturePacker (best packing algorithm, multiple formats)\n\n---\n\n## 📦 Working with Existing Assets\n\n### Kenney.nl (CC0, Recommended)\n- **Status**: Pre-packed sprite sheets with XML\u002FJSON metadata\n- **Example**: `characters.png` (1024×1024, 64 characters)\n- **Usage**: Load directly, parse XML for coordinates\n- **Rust parsing**: Use `quick-xml` or `serde_json` crate\n\n### Unity Asset Store (⚠️ Avoid for Public Games)\n**Extraction Script** (Unity Editor C#):\n```csharp\nusing UnityEngine;\nusing UnityEditor;\nusing System.IO;\n\npublic class SpriteSheetExporter : EditorWindow {\n    [MenuItem(\"Tools\u002FExport Sprite Sheet\")]\n    static void Export() {\n        var sprites = Selection.GetFiltered\u003CSprite>(SelectionMode.Assets);\n        if (sprites.Length == 0) return;\n        \n        var texture = sprites[0].texture;\n        var path = EditorUtility.SaveFilePanel(\"Export\", \"\", \"spritesheet.png\", \"png\");\n        \n        \u002F\u002F Copy texture to path\n        File.WriteAllBytes(path, texture.EncodeToPNG());\n        \n        \u002F\u002F Export metadata\n        var json = \"[\";\n        foreach (var s in sprites) {\n            var r = s.textureRect;\n            json += $\"{{\\\"name\\\":\\\"{s.name}\\\",\\\"x\\\":{r.x},\\\"y\\\":{r.y},\\\"w\\\":{r.width},\\\"h\\\":{r.height}}},\";\n        }\n        json = json.TrimEnd(',') + \"]\";\n        File.WriteAllText(path + \".json\", json);\n    }\n}\n```\n**⚠️ Legal Note**: Most Unity Asset Store licenses prohibit redistribution. Use only for private projects or local testing.\n\n---\n\n## 🎯 Best Practices\n\n### 1. Texture Sizing\n- **Power of 2**: 512, 1024, 2048 (GPU-friendly, though not strictly required on modern hardware)\n- **Mobile**: Max 2048×2048 (some devices limit 4096)\n- **Padding**: 1-2px between sprites to avoid bleeding\n\n### 2. Format Selection\n- **Pixel Art**: PNG-8, nearest neighbor filtering\n- **Smooth Sprites**: PNG-24 with alpha\n- **Large Atlases**: Use compression (WebP for web, ETC2\u002FASTC for mobile)\n\n### 3. Animation Optimization\n- **Frame Reuse**: Mirror\u002Fflip frames instead of duplicating\n- **Variable FPS**: Slow down idle animations, speed up impacts\n- **LOD**: Swap to simpler sprite sheets for distant objects\n\n### 4. Memory Management\n- **Lazy Loading**: Load atlases per-level, unload on scene change\n- **Atlas Splitting**: Group by usage (UI, enemies, environment)\n- **Mipmap Disable**: For pixel art and UI sprites\n\n### 5. Development Workflow\n```\n1. Create sprites (Aseprite\u002FPhotoshop)\n2. Export individual PNGs\n3. Pack with TexturePacker → atlas.png + atlas.json\n4. Load in engine with custom parser or plugin\n5. Test on target devices (mobile = critical)\n```\n\n---\n\n## 📚 Additional Resources\n\n### Official Documentation\n- [Macroquad Texture Docs](https:\u002F\u002Fdocs.rs\u002Fmacroquad\u002Flatest\u002Fmacroquad\u002Ftexture\u002F)\n- [Bevy TextureAtlas Guide](https:\u002F\u002Fbevyengine.org\u002Fexamples\u002F2d\u002Ftexture-atlas\u002F)\n- [Godot AnimatedSprite2D](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Fstable\u002Fclasses\u002Fclass_animatedsprite2d.html)\n\n### Metadata Parsers\n- **Rust**: `serde_json`, `quick-xml`, `ron`\n- **Godot**: Built-in JSON parser, ResourceLoader\n\n### Testing Assets\n- [Kenney.nl Sprite Packs](https:\u002F\u002Fkenney.nl\u002Fassets?q=2d) (CC0)\n- [OpenGameArt](https:\u002F\u002Fopengameart.org\u002F) (various licenses)\n- [itch.io Game Assets](https:\u002F\u002Fitch.io\u002Fgame-assets\u002Ffree) (check licenses)\n\n---\n\n## ✅ Checklist for Implementation\n\n- [ ] Choose sprite sheet tool based on workflow\n- [ ] Set texture filter mode (Nearest for pixel art)\n- [ ] Implement frame-based animation system\n- [ ] Add padding to prevent texture bleeding\n- [ ] Test on target platforms (mobile memory limits!)\n- [ ] Profile draw calls (should see reduction with atlases)\n- [ ] Document atlas structure for team (JSON format)\n- [ ] Set up hot-reload for rapid iteration\n\n---\n\n## 🔗 See Also\n- `game-dev-rust-godot\u002F` - Main tech stack documentation\n- `AGENTS.md` - Asset license policy (Kenney.nl CC0 only for public games)\n- `\u002FVolumes\u002Fworkspace\u002FAsset Store-5.x\u002F` - Local Unity assets (private use only)\n\n---\n\n**Last Updated**: 2026-02-06  \n**Maintained By**: Agent (kjaylee workspace)\n",{},"main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fkjaylee\u002Fsprite-sheet",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill sprite-sheet",{"tool":37,"command":38},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill sprite-sheet",{"tool":40,"command":41},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill sprite-sheet","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkjaylee\u002Fsprite-sheet\u002FSKILL.md",true,[],[46,54,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":53},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":53},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":53},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":53},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":53},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":53},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]