lunny

Members
  • Content count

    5
  • Joined

  • Last visited

  1. Phaser Atlas Sprite Size

    Ah ok, Thanks Rich! Looks like I'll have to trim the images myself. Good luck on phaser v3!
  2. Phaser Atlas Sprite Size

    I thought Texture Packer trims the images, or does the original image has to be trimmed? Here is the exported trimmed sprite sheet by Texture Packer. Would it work? https://github.com/lunzhang/maplefighter/blob/master/resources/imgs/heroes/pirate/pirate.png
  3. Phaser Atlas Sprite Size

    I want the Sprite size and physics body to be the trimmed size. I did trim the images in the sprite sheet if that's what you mean. I used TexturePacker to trim the images and save it as png and exported the atlas as Phaser JSON.
  4. Phaser Atlas Sprite Size

    Hi Rich! I want the sprite's body width/height to be the trimmed values. My sprite sheet is trimmed but the sprite's body width/height is still displaying the sourceSize of 300x300 instead of the trimmed size. Some of the code. this = Phaser.State this.game.load.atlas(HeroTypes.WARRIOR + '-sprite', 'resources/imgs/heroes/warrior/warrior.png', 'resources/imgs/heroes/warrior/warrior.json'); this = Phaser.Group this.sprite = this.create(0, 0, HeroTypes.WARRIOR + '-sprite'); Heres the git repo if you want to take a look. The atlas is loaded in boot.js and the sprite is created in Warrior.js. https://github.com/lunzhang/maplefighter
  5. Phaser Atlas Sprite Size

    I have a sprite created from atlas. Everything works fine expect that the sprite is the size of the original image not the trimmed version. For Example, my sprite is 300x300 but I want it to the trimmed size of 110x93. How can I do that? { "filename": "stand1", "frame": {"x":1077,"y":708,"w":110,"h":93}, "rotated": false, "trimmed": true, "spriteSourceSize": {"x":119,"y":98,"w":110,"h":93}, "sourceSize": {"w":300,"h":300} }