Author Topic: NGUI Countdown Clock Transform 360  (Read 1523 times)

coxy17

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
NGUI Countdown Clock Transform 360
« on: January 31, 2017, 06:27:34 PM »
Hi

I wanted to ask if its possible to make a clock with a rotating hand in NGUI?

I am experimenting and i have a old asset which achieves this but i would rather solely use NGUI and not another asset. Also as the asset is old and use the legacy gui it create alot of garbage being generated from he transform3d.

The attached image shows a clock back with an arrow as the hand, it rotates from 0 to 360 and when it finishes calls an event finished. The duration of the rotation is based on a value specified in the 'value max' and this is the total number of seconds it will take. I use this for the total time per level.

I hope anyone can help or help me understand where i can start to recreate this in NGUI

this is how the other asset works (http://energybartoolkit.madpixelmachine.com/doc/3.0.9/components/ugui/transform.html)

Thanks

Nick

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Countdown Clock Transform 360
« Reply #1 on: February 04, 2017, 03:44:01 AM »
Seems like it would be trivial, no? Just have a sprite for the clock's background with a child sprite for the clock's arrow. Set the Z rotation for the arrow sprite anywhere from 0 to 360 based on the time.