Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong anchor position on Sprite/GameObject #4155

Closed
Zax37 opened this issue Nov 10, 2018 · 7 comments
Closed

Wrong anchor position on Sprite/GameObject #4155

Zax37 opened this issue Nov 10, 2018 · 7 comments

Comments

@Zax37
Copy link

Zax37 commented Nov 10, 2018

Update from Phaser 3.13 to 3.14 or 3.15 brought new rendering bug regarding anchors.

Steps to reproduce(first two might be not necessary)

  • create new texture atlas with anchor positions set
  • create new animation from this atlas
  • create new sprite, play the animation on it

The sprite moves different than intended (in my case it shouldn't move at all!)

@Zax37
Copy link
Author

Zax37 commented Nov 12, 2018

I've recorded this and other bug I'm struggling with (#3813):

In 3.13 only flipped anchor is broken:
https://cdn.discordapp.com/attachments/416623653741133837/511464613028560897/3.13.0.webm

But in 3.14+ (here be 3.15.1) EVERYTHING with anchors is broken:
https://cdn.discordapp.com/attachments/416623653741133837/511464626303795220/3.15.1.webm

@photonstorm
Copy link
Collaborator

Please provide an animation we can test this with.

@Zax37
Copy link
Author

Zax37 commented Nov 21, 2018

  1. Sprite atlas: http://captainclaw.net/dl/CLAW_SPRITESHEET.zip

  2. Animations definition:

  this.game.anims.create({
    key: 'stand',
    frames: this.game.anims.generateFrameNames('CLAW',
      {prefix: 'CLAW_', start: 11, end: 18}),
    frameRate: 9,
    repeat: -1
  });

  this.game.anims.create({
    key: 'walk',
    frames: this.game.anims.generateFrameNames('CLAW',
      {prefix: 'CLAW_', start: 1, end: 10}),
    frameRate: 13,
    repeat: -1
  });
  1. Body size & offset:
  this.setSize(32, 112);
  this.setOffset(32, 1);

Final effect should look same as on the uploaded videos.

More code, if needed: https://github.com/Zax37/ClawJS

@Zax37
Copy link
Author

Zax37 commented Nov 30, 2018

Does it need any more examples?

@photonstorm
Copy link
Collaborator

Once I've had a chance to look at your code I'll you know if we need anything more.

@hexus
Copy link
Contributor

hexus commented Feb 17, 2019

An explicit, minimal reproduction of this issue in a sandbox like JSBin or Codepen would be really helpful.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants