Author Topic: Please fix UISpriteAnimation  (Read 3862 times)

pioj

  • Guest
Please fix UISpriteAnimation
« on: May 03, 2012, 11:04:33 AM »
Hi. Nice to meet u all!

There's a little issue with UISpriteAnimation script, as it rescales to pixel-perfect while the animation is playing.

It's located at the Update() method, line 60: mSprite.MakePixelPerfect();

This forces us to keep 1:1 pixel scale on sprites we want to be animated. I've tried adding one sprite to an empty parent, but sooner or later turns to be a chaos..

If you need to keep that instruction because of a glitch or something, I'd recommend you to take in count the actual scale for that sprite, too..



Does anyone else is using animated sprites in games?
« Last Edit: May 03, 2012, 11:11:29 AM by pioj »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Please fix UISpriteAnimation
« Reply #1 on: May 03, 2012, 11:07:00 AM »
It's necessary because one animation frame's size may not match the next. Think of a sprite that's standing still: it's tall and narrow. Now think of a running sprite: it's more square in shape. If you don't pixel-perfect the sprite, it will be stretched as you go from one sprite to the next. If you want to scale your animated sprite, scale its parent.