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

cacheAsBitmap / generateTexture offset sprite positions #283

Closed
fyyyyy opened this issue Jul 14, 2017 · 2 comments
Closed

cacheAsBitmap / generateTexture offset sprite positions #283

fyyyyy opened this issue Jul 14, 2017 · 2 comments
Milestone

Comments

@fyyyyy
Copy link

fyyyyy commented Jul 14, 2017

This is an underlying PIXI issue i believe. However its good to notify in the docs that those methods cacheAsBitmap / generateTexture are offsetting sprite positions. The reason is that transparent pixels around graphics are cut automatically, and therefore the sprite positions get shifted. This happens since 2.3 up to 2.8.1

So the docs should give a warning i believe.

@fyyyyy fyyyyy changed the title cacheAsBitmap / generateTexture random position in groups cacheAsBitmap / generateTexture offset sprite positions Jul 14, 2017
@samme
Copy link
Collaborator

samme commented Jul 14, 2017

I've noticed this with graphics.generateTexture().

It happens with group.cacheAsBitmap = true also?

@fyyyyy
Copy link
Author

fyyyyy commented Jul 14, 2017

I havent tried with a group but it happens with sprites that have children.
I have seen bug reports of this happening with groups.
phaserjs/phaser#1925
and
http://www.html5gamedevs.com/topic/15916-problem-with-phasergroup-and-cacheasbitmap/

@samme samme modified the milestone: 2.8.4 Jul 21, 2017
@samme samme closed this as completed in 4c736a6 Jul 28, 2017
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

2 participants