gorgonDart icon indicating copy to clipboard operation
gorgonDart copied to clipboard

Sprite field in Map should be restructured

Open cantidio opened this issue 10 years ago • 1 comments

Sprite HashMap should be remade to me more simple and dynamic.

instead of

 {
   "image": "image-source", xoffset: 10, yoffset: 20
}

to

{
  "src": "image-source", "xoffset": 10, "yoffset": 20, "x": 5, "y":5, "width": 30, "height": 30
}

this accepting the same syntax for normal sprites and sprites in a spritesheet.

cantidio avatar Sep 12 '14 04:09 cantidio

maybe use:

{
  "spritepack": {
    "version": 0.1,
    "imageSrc": "global-image-source.png",
    "groups": {
      "group-0":{
        "imageSrc": "group-image.png", // if this field is omitted then it will use the spritepack image-uri
        "frames":[
          {
            "imageSrc": "image-source",  // if this field is omitted then it will use the groups image-uri
            "xoffset": 10, 
            "yoffset": 20, 
            "x": 5, 
            "y":5, 
            "width": 30,
            "height": 30
          }
        ]
      }
    }
  }
}

cantidio avatar Sep 12 '14 22:09 cantidio