Skip to content

Feature Request - SpriteSets #3073

Open
@jetrotal

Description

@jetrotal

SpriteSets

A new folder in your project, where each asset needs:

  • A png sprite sheet
  • A Json/XML file describing each animation frame and duration from multiple sets of pose(Ghabry Preffers JSON).

Then you can attach those special files to anything: Battlechars, charsets, Monsters, pictures, etc...
With that you can set up assets like:

  • charsets with more than 3 frames, or custom size, or custom hitbox.
  • Animated Monsters/pictures/facesets
  • slower pictures with variable speed.
  • etc...

one way to call it is instead of using on a charset the string "actor1" you could call "*spriteset/actor1.walk_poses"

reference - Sprites from Duelyst opensource Game:
https://github.com/open-duelyst/duelyst/tree/main/app/resources/units

image

example code

{
	"sprites": {
		"1":{
			"xy": [0,0],
			"wh": [128,128]
			},
		"2":{
			"xy": [128,0],
			"wh": [128,128]
		},
		"3":{
			"xy": [0,128],
			"wh": [128,128]
		},
		"4":{
			"xy": [128,128],
			"wh": [128,128]
		}

	},
	"animations": {
		"walk_idle":{
			"frames":[1,2,3,4],
			"fps":12,
			"onEnd":"loop" // play from 1
		},
		"walk_up":{
			"frames":[1,2,3,4],
			"fps":12,
			"onEnd":"pingpong" // play in reverse then play again
		},
		"walk_down":{
			"frames":[1,2,3,4],
			"fps":12,
			"onEnd":"stop" // stop at last frame
		},
		"walk_left":{
			"frames":[1,2,3,4],
			"fps":12,
			"onEnd":"play('walk_idle')" // start animation from another entry
		},
		"walk_right":{
			"frames":[1,2,3,4],
			"fps":12,
			"onEnd":"remove" // blank frame
		},
	},
	"meta":{
		"fileName":"hero1.png",
		"wh":[256,256]
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions