I can’t be the only one distorting sprite objects with RectPath. Also, It would be useful to know if someone is succesfully doing this without the mentioned pixelation on device. Anyone?
I solved a similar issue with fills by adjusting the xScale and yScale of the fill.
Maybe you could apply a scale to the sprite just before it distorts? The result will still be strange buy maybe it could fix the pixelation.
[lua]
local newHeight = object.height - 20 – 20 was the value used in the example
object.yScale = newHeight / object.height – yScale as a percentage equal to the distortion
[/lua]
What size are the sprites? Sometimes making the size of object and images equal to a power or 2 fixes problems like pixelation or blank images. I’m not always sure why it worked but I have fixed graphic problems in the past by making the images size equal to a power or 2 and then scaling down.
I’m not sure what is the idea behind scaling the sprite first…To me, this looks like a serious bug. It works perfectly in the simulator and the first frame works also on device.
The size of sprite sheet is already power of two(1024x256), but the frame is not.
Could be a bug for sure. My thought about scaling was that if you scale the object it might force a recalculation of the graphics.
Hi @polygonblog,
Please file a simple bug report with mini-project showing this happening, so we can investigate on our side.
Thanks,
Brent
sharp100: I see your logic. I tested scaling but unfortunately it makes no difference. Thank you anyway!
Brent: Ok, I just filed a bug report with the name “RectPath Manipulation on Sprite Object Causes Strange Pixelation on Device”.
Hi @polygonblog,
Thanks! In the meantime, while it’s being processed on the support side, can you email me the project personally? I’d like to quickly glance at it and see the code right now, in case there’s something I’m unclear on. Email is brent (at) coronalabs (dot) com.
Brent
Ok, will do!
Hi @polygonblog,
In the project you sent me, there is no actual sprite animation going on (just two frames used for two different sprites, neither of which animate), so I can’t see the issues you mentioned above.
What I do see, however, is that the second object flickers and has some graphical glitches when the path is transitioned. This doesn’t appear to be a new issue (I tested with builds even earlier than 2992), but it’s clearly a bug which we’ll need to explore.
If you want to send me another project with actual frames to animate in a sprite sequence, please do.
Brent
Thanks for looking into this! You are correct there is no animation running, but graphical glitches show up just by showing any other frame than 1st from the sprite sequence.
Yes, good point… I’m seeing that too. Thanks for providing this test case!