Hello Guest

Author Topic: Is it possible to skew a sprite?  (Read 4866 times)

Kieranb

  • Newbie
  • *
  • Posts: 2
    • View Profile
Is it possible to skew a sprite?
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is it possible to skew a sprite?
« Reply #1 on: April 30, 2014, 05:14:33 pm »
No it isn't.

Kieranb

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Is it possible to skew a sprite?
« Reply #2 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!

wagenheimer

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: Is it possible to skew a sprite?
« Reply #3 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.
« Last Edit: May 06, 2014, 02:23:59 pm by wagenheimer »

zettam

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Is it possible to skew a sprite?
« Reply #4 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.

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Is it possible to skew a sprite?
« Reply #5 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.