sprite_local_uv.script 360 B

12345678910
  1. function init(self)
  2. -- get the sprite size from the sprite component propertry 'size'
  3. local size = go.get("#sprite", "size")
  4. -- set the size on the sprite material in the custom vertex attribute 'sprite_size'
  5. go.set("#sprite", "sprite_size", size)
  6. -- rotate the sprite
  7. go.animate(".", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 5)
  8. end