{"id":18556594,"url":"https://github.com/valkryst/v2dsprite","last_synced_at":"2025-04-10T01:31:18.928Z","repository":{"id":142749630,"uuid":"131231488","full_name":"Valkryst/V2DSprite","owner":"Valkryst","description":"A Java2D library which allows for easy management, loading, and use of sprite sheets.","archived":false,"fork":false,"pushed_at":"2025-03-17T04:06:48.000Z","size":104,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T14:07:30.475Z","etag":null,"topics":["atlas","awt","bufferedimage","canvas","game","game-2d","game-development","gamedev","graphics2d","hacktoberfest","java2d","java2d-game-library","library","sprite","sprite-animation","sprite-atlas","sprite-sheet","spritesheet","texture-atlas","volatileimage"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Valkryst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Valkryst"}},"created_at":"2018-04-27T01:53:39.000Z","updated_at":"2025-02-26T17:38:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e35fdec6-f565-4cc9-b486-f67b7dade8f5","html_url":"https://github.com/Valkryst/V2DSprite","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FV2DSprite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FV2DSprite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FV2DSprite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FV2DSprite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Valkryst","download_url":"https://codeload.github.com/Valkryst/V2DSprite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140320,"owners_count":21054279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atlas","awt","bufferedimage","canvas","game","game-2d","game-development","gamedev","graphics2d","hacktoberfest","java2d","java2d-game-library","library","sprite","sprite-animation","sprite-atlas","sprite-sheet","spritesheet","texture-atlas","volatileimage"],"created_at":"2024-11-06T21:32:09.271Z","updated_at":"2025-04-10T01:31:13.917Z","avatar_url":"https://github.com/Valkryst.png","language":"Java","funding_links":["https://github.com/sponsors/Valkryst"],"categories":[],"sub_categories":[],"readme":"[![Java CI with Maven](https://github.com/Valkryst/V2DSprite/actions/workflows/maven.yml/badge.svg)](https://github.com/Valkryst/V2DSprite/actions/workflows/maven.yml)\r\n\r\nI will eventually publish a sample project, which demonstrates the full use of\r\nthis library.\r\n\r\n## Table of Contents\r\n\r\n* [Installation](https://github.com/Valkryst/V2DSprite#installation)\r\n\t* [Gradle](https://github.com/Valkryst/V2DSprite#-gradle)\r\n\t* [Maven](https://github.com/Valkryst/V2DSprite#-maven)\r\n\t* [sbt](https://github.com/Valkryst/V2DSprite#-scala-sbt)\r\n* [Terminology](https://github.com/Valkryst/V2DSprite#terminology)\r\n* [Folder Structure](https://github.com/Valkryst/V2DSprite#folder-structure)\r\n* [File Structure](https://github.com/Valkryst/V2DSprite#file-structure)\r\n* [Supported Image Formats](https://github.com/Valkryst/V2DSprite#supported-image-formats)\r\n* [Credits \u0026 Inspiration](https://github.com/Valkryst/V2DSprite#credits--inspiration)\r\n\r\n## Installation\r\n\r\nV2DSprite is hosted on the [JitPack package repository](https://jitpack.io/#Valkryst/V2DSprite)\r\nwhich supports Gradle, Maven, and sbt.\r\n\r\n### ![Gradle](https://i.imgur.com/qtc6bXq.png?1) Gradle\r\n\r\nAdd JitPack to your `build.gradle` at the end of repositories.\r\n\r\n```\r\nallprojects {\r\n\trepositories {\r\n\t\t...\r\n\t\tmaven { url 'https://jitpack.io' }\r\n\t}\r\n}\r\n```\r\n\r\nAdd V2DSprite as a dependency.\r\n\r\n```\r\ndependencies {\r\n\timplementation 'com.github.Valkryst:V2DSprite:2023.02.24-break-fixed'\r\n}\r\n```\r\n\r\n### ![Maven](https://i.imgur.com/2TZzobp.png?1) Maven\r\n\r\nAdd JitPack as a repository.\r\n\r\n``` xml\r\n\u003crepositories\u003e\r\n    \u003crepository\u003e\r\n        \u003cid\u003ejitpack.io\u003c/id\u003e\r\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\r\n    \u003c/repository\u003e\r\n\u003c/repositories\u003e\r\n```\r\nAdd V2DSprite as a dependency.\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003ecom.github.Valkryst\u003c/groupId\u003e\r\n    \u003cartifactId\u003eV2DSprite\u003c/artifactId\u003e\r\n    \u003cversion\u003e2023.02.24-break-fixed\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n### ![Scala SBT](https://i.imgur.com/Nqv3mVd.png?1) Scala SBT\r\n\r\nAdd JitPack as a resolver.\r\n\r\n```\r\nresolvers += \"jitpack\" at \"https://jitpack.io\"\r\n```\r\n\r\nAdd V2DSprite as a dependency.\r\n\r\n```\r\nlibraryDependencies += \"com.github.Valkryst\" % \"V2DSprite\" % \"2023.02.24-break-fixed\"\r\n```\r\n\r\n## Terminology\r\n\r\n* A [SpriteSheet](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/SpriteSheet.java) contains one or more [Animations](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Animation.java).\r\n* An [Animation](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Animation.java) contains one or more [Frames](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Frame.java).\r\n* A [Frame](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Frame.java) can have a [CollisionBox](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/CollisionBox.java).\r\n* A [Frame](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Frame.java) can have a [Hitbox](https://github.com/Valkryst/V2DSprite/blob/master/src/main/java/com/valkryst/V2DSprite/Hitbox.java).\r\n\r\n## Folder Structure\r\n\r\nV2DSprite assumes that all of your data is located within the `sprites` folder,\r\nwithin your `.jar` file.\r\n\r\nEach subfolder of the `sprites` folder must contain one sprite sheet, named\r\n`image.extension` and an `animations` folder.\r\n\r\nThe `animations` folder must contain all of the `_collisionbox.tsv`,\r\n`_frame.tsv`, and `_hitbox.tsv` files for each animation in the sprite sheet.\r\n\r\nSee the following heirarchy, as an example:\r\n\r\n* sprites\r\n  * slime_green\r\n    * image.png\r\n    * animations\r\n\t    * idle_collisionbox.tsv\r\n\t    * idle_frame.tsv\r\n\t    * idle_hitbox.tsv\r\n\t    * walk_collisionbox.tsv\r\n\t    * walk_frame.tsv\r\n\t    * walk_hitbox.tsv\r\n  * slime_purple\r\n    * image.tiff\r\n    * animations\r\n\t    * idle_collisionbox.tsv\r\n\t    * idle_frame.tsv\r\n\t    * idle_hitbox.tsv\r\n\t    * walk_collisionbox.tsv\r\n\t    * walk_frame.tsv\r\n\t    * walk_hitbox.tsv\r\n  * skeleton\r\n    * image.jpeg\r\n    * animations\r\n      * attack_collisionbox.tsv\r\n      * attack_frame.tsv\r\n      * attack_hitbox.tsv\r\n      * idle_collisionbox.tsv\r\n      * idle_frame.tsv\r\n      * idle_hitbox.tsv\r\n      * walk_collisionbox.tsv\r\n      * walk_frame.tsv\r\n      * walk_hitbox.tsv\r\n\r\n## File Structure\r\n\r\nEach row of the `.tsv` files correspond with one another. So, the first row in\r\n`_frame.tsv` defines a _Frame_ and the first row in `_collisionbox.tsv` defines\r\nthe _Collision Box_ for that _Frame_.\r\n\r\nYou are not required to use the `_collisionbox.tsv` or `_hitbox.tsv` files, but\r\nthey are a useful feature for loading/working with that data in your projects.\r\n\r\nPlease remember that the values are seperated by _tabs_, not spaces.\r\n\r\n### frame.tsv\r\n\r\nA _Frame_ is defined by:\r\n\r\n* X-Axis offset, from the top-left pixel of the _Sprite Sheet_.\r\n* Y-Axis offset, from the top-left pixel of the _Sprite Sheet_.\r\n* Width of the _Frame_ (sprite).\r\n* Height of the _Frame_ (sprite).\r\n* Duration, in milliseconds, that the _Frame_ should be displayed during an _Animation_.\r\n\r\ne.g. `xOffset yOffset width height duration`\r\n\r\n### collisionbox.tsv\r\n\r\nA _Collision Box_ is defined by:\r\n\r\n* X-Axis offset, from the top-left pixel of the _Frame_.\r\n* Y-Axis offset, from the top-left pixel of the _Frame_.\r\n* Width of the _Frame_ (sprite).\r\n* Height of the _Frame_ (sprite).\r\n\r\ne.g. `xOffset yOffset width height`\r\n\r\n### hitbox.tsv\r\n\r\nA _Hitbox_ is defined by:\r\n\r\n* X-Axis offset, from the top-left pixel of the _Frame_.\r\n* Y-Axis offset, from the top-left pixel of the _Frame_.\r\n* Width of the _Frame_ (sprite).\r\n* Height of the _Frame_ (sprite).\r\n\r\ne.g. `xOffset yOffset width height`\r\n\r\n## Supported Image Formats\r\n\r\nThis library uses `javax.imageio` to load images, and it supports the following\r\nformats:\r\n\r\n* `bmp`\r\n* `gif`\r\n* `jpeg`/`jpg`\r\n* `png`\r\n* `tiff`/`tif`\r\n* `wbmp`\r\n\r\n## Credits \u0026 Inspiration\r\n\r\n* [LionEngine](https://github.com/b3dgs/lionengine)\r\n* [LITIENGINE](https://github.com/gurkenlabs/litiengine)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkryst%2Fv2dsprite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalkryst%2Fv2dsprite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkryst%2Fv2dsprite/lists"}