Hello Guest

Author Topic: flipX !  (Read 4107 times)

kenshin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
flipX !
« on: August 27, 2013, 11:40:59 pm »
1) How can I flip sprite with trimmed area ?

When I try to flip sprite, it flips the sprite based on sprite size, not based on trimmed sprite size. Or should I make another collection for sprites that should be used as flipped so that when I change my sprite directionI can use another collection without flipping. what is the best practice for flipping and character direction usage cases ?

2) Why animated sprite size is big, although we set sprite as trimmed ?

3) I have 256x256 sprites in size, 400 in number and with a lot of space in them. they are imported as trimmed in sprite collection. If I delete them  i will loose all of my animations. How can I reimport them without loosing my sprite collection definitions and animations.

4) I need `padding` and `extra padding` explanation and usage areas.

5) which is fastest: changing scale on transform or on sprite ? why ?

Thanks in advance for good support :)
« Last Edit: August 28, 2013, 05:57:56 am by kenshin »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: flipX !
« Reply #1 on: August 28, 2013, 10:57:14 am »
1. You can't. Trimmed treats it as though it was still the original untrimmed size. You'll need to trim by hand if you want the origin to be the center after trimming.

2. I'm not sure what you're asking here.

3. You should just overwrite the files rather than deleting them and adding them back in again - that changes the GUID in Unity. You shouldn't do that on any textures/assets in Unity.

4. Padding = adds padding around your texture so it filters properly. Google texture padding for more details. Extra padding increases the padding on a particular sprite - usually used when you see artefacts.

5. sprite.scale changes geometry, but doesn't break unity batching. transform.localScale breaks batching but is instantaneous as it doesn't change geometry. If you have a few sprites and dont care about batching, transform.localScale is faster, otherwise sprite.scale will be faster.