Jump to content

Need help in resizing sprite sheet


Hirikgg
 Share

Recommended Posts

so I created a spritesheet online and and added to my game.
but some sprites are small in size so how do I change the size of sprite:
 

{
      "filename": "Attack__004",
      "frame": {
        "x": 1,
        "y": 1951,
        "w": 111,
        "h": 96
      },
      "rotated": false,
      "trimmed": true,
      "spriteSourceSize": {
        "x": 9,
        "y": 5,
        "w": 111,
        "h": 96
      },
      "sourceSize": {
        "w": 120,
        "h": 110
      },
      "pivot": {
        "x": 0.5,
        "y": 0.5
      }
    },

I don't know which one is the height and width of image.


So do can I resize the image inside the json file or I must manually resize and pack it again?

Btw, I used this tool http://free-tex-packer.com/app/ (no PC to use texture packer :-) )

Thanks in advance

Link to comment
Share on other sites

  • 2 weeks later...

If your source sprites are smaller than you need (i.e. draw a box around the sprite in spritesheet using any drawing tool and it'll tell you how many pixels wide and high it is) then you'll need to repack them.

I'm not sure what spriteSourceSize and sourceSize refer to, but they are different aspect ratios, so it isn't just that one is a scaled version of the other.

Normally sprites refer to bounding boxes in the spritesheet, from which you can use portions of the sheet. If that portion is smaller than you need then you either need to enlarge it when using it (which will result in loss of image clarity) or make it larger in the first place.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...