Closed Darky-Lucera closed 8 years ago
Another one:
4- Seems that the hitAreas of the images/sprites in the spriteBatch do not work properly. It seems that are scaled and in a first plane disallowing buttons that were in front.
These same hitAreas worked well out of the spriteBatch.
Closing due to several months of inactivity. A stand-alone running code example is needed to investigate this further.
Hi!
I observed some problems using spriteBatch (using CANVAS on Phaser 2.4.4)
1- Sometimes the texture coordinates are not well calculated when using atlases for sprites/images. The spriteBatch draws a bigger texture area (sometimes). It seems to me that it draws until the next power of two to the right and to bottom.
Example: if you have a texture atlas of 100x40 it seems to draw 128x64.
2- Sometimes the image position is not well calculated when using atlases for sprites/images with animations.
I have a head making nod that works perfectly when its alone but it jumps a bit when in a spriteBatch. It has anchor (0.5, 1) and a yoyo animation that rotates it.
3- The textures with negative scale are not well drawn.
I can fix that changing a line of code in the function: PIXI.SpriteBatch.prototype._renderCanvas
This line: if (child.rotation % (Math.PI * 2) === 0) For this one: if (child.rotation % (Math.PI * 2) === 0 && child.scale.x >= 0 && child.scale.y >= 0)
But the image with negative scale is not well positioned and is a bit blurred (all it's ok when alone).
Thanks