2D Toolkit Forum

2D Toolkit => Support => Topic started by: Kieranb on April 30, 2014, 05:26:14 am

Title: Is it possible to skew a sprite?
Post by: Kieranb on April 30, 2014, 05:26:14 am
Hi there,

Just wondering if it's possible to skew a sprite at run time, so that the top half moves while the bottom half stays put.
Title: Re: Is it possible to skew a sprite?
Post by: unikronsoftware on April 30, 2014, 05:14:33 pm
No it isn't.
Title: Re: Is it possible to skew a sprite?
Post by: Kieranb on May 01, 2014, 12:06:19 am
Ah Ok thanks. Love 2D Toolkit, first feature I've ever come across that hasn't been implemented already.

Keep being awesome!
Title: Re: Is it possible to skew a sprite?
Post by: wagenheimer on May 06, 2014, 02:22:12 pm
Set the anchor to Lower Center and change it's Scale Y.... I think this will give you what you want.
Title: Re: Is it possible to skew a sprite?
Post by: zettam on May 07, 2014, 03:19:47 am
I think it would also be good to implement a skew for the tk2d textmesh as well. It would be good to create "italic" on the fly :)

I generally work around this by rotating the text/sprite in two axes. Works for 2d games --- 3d rotation becomes 2d skew from the point of view of the camera.
Title: Re: Is it possible to skew a sprite?
Post by: Evil-Dog on May 12, 2014, 08:51:01 pm
I've done skewing by changing the mesh's vertices, it may break the batching but not sure about that. I think I also had to change some of the tk2d code to access the vertices array too.