Author Topic: New Anchors and UISpriteAnimation  (Read 5838 times)

PaulGregory

  • Guest
New Anchors and UISpriteAnimation
« on: December 09, 2013, 01:20:22 PM »
(I'm considering this to be a separate issue to my beef with anchor scaling).

On every frame of a UISpriteAnimation that has the new Anchors system, I see the frame first at 100% scale, then at the scaling I'm specifying within Anchors - so I have the same animation flickering at two sizes.

This didn't happen with the old Anchor script.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New Anchors and UISpriteAnimation
« Reply #1 on: December 09, 2013, 01:45:37 PM »
Anchors are meant to anchor sides. You can anchor the center just by parenting the object to something. Anchors set the sides, and animations call MakePixelPerfect, which also changes the dimensions. Thus - a conflict.

PaulGregory

  • Guest
Re: New Anchors and UISpriteAnimation
« Reply #2 on: December 09, 2013, 02:12:59 PM »
Did animations always call MakePixelPerfect?

I've updated to 3.0.7 f1 and I can't find a way to make this animation smaller without resizing - even with Anchors set to None, anything I change gets reset.

(It's a loading circle that I use elsewhere in the app at full size, but on the splash screen I want to use it at 10%).


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New Anchors and UISpriteAnimation
« Reply #3 on: December 09, 2013, 02:14:35 PM »
Don't use anchors on the animated sprite. Anchor its parent if you must. Or don't anchor at all. The sprite will always be relative to something by default -- relative to its parent.

PaulGregory

  • Guest
Re: New Anchors and UISpriteAnimation
« Reply #4 on: December 09, 2013, 02:22:34 PM »
I should have made myself clearer.

I now have Anchors set to None and the problem remains:

If I scale the sprite in the Transform scale, it resets to 1 on play thanks to the animation.

If I scale the sprite within Widget Dimensions, it resets to the natural size on play thanks to the animation.

Is Anchors remembering something it shouldn't, or has it recently become impossible to scale an animation?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New Anchors and UISpriteAnimation
« Reply #5 on: December 09, 2013, 04:10:34 PM »
No, if anchor is none, then there is no anchoring. Nothing is kept. Your animation likely changes the scale. I suggest double checking.

PaulGregory

  • Guest
Re: New Anchors and UISpriteAnimation
« Reply #6 on: December 11, 2013, 03:08:00 AM »
*My* animation likely changes the scale?

It seems I should make myself absolutely clear in every response, rather than relying on key information being in the title.

I'm using UISpriteAnimation. It has the options Framerate, Name prefix and Loop.
This isn't an animation with curves or anything, it's just changing the frames. (I assume. I didn't write UISpriteAnimation.). Yet it changes the transform from 0.1 (or whatever I set) to 1 and the widget size from 24x24 (or whatever I set) to 128x128.

If I uncheck UISpriteAnimation, the sprite stays at the scale I set.

Thankfully I use this animation at full size on most screens, so it's only affecting one part at the moment. The obvious solution is for me to include a set of frames at the smaller size.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New Anchors and UISpriteAnimation
« Reply #7 on: December 12, 2013, 02:09:09 AM »
GameObject (scale this as you see fit)
- Sprite (UISpriteAnimation)

Don't scale the sprite.