Hello everyone,
Newbie question : I am trying to create an animation of a label moving like a pendulum. I tried using a SpriteLabel rotating around an arbitrary point using Action.rotate_by, but it always rotates around the lower left corner of the screen (0, 0) and not around the top center, is there any way around this ?
Here is the exact code I am using:
from scene import *
from math import *
class MyScene(Scene):
def setup(self):
self.background_color = 'black'
self.anchor_point = (0.5, 0.0)
self.timelabel = LabelNode(position=self.size / 2, text='time')
self.add_child(self.timelabel)
self.timelabel.rotation = -pi / 8.0
self.run_action(Action.repeat(Action.sequence(Action.rotate_by(pi / 4.0, 1, TIMING_EASE_IN_OUT), Action.rotate_by(-pi / 4.0, 1, TIMING_EASE_IN_OUT), 0), 0))
run(MyScene(), PORTRAIT)
Cheers
Andre