orbitTo()

Orbits an element to x, y, z degrees around the corresponding axis. Orbitations are always around the origin of the parent element's coordinate system. If the element was not moved off the origin then orbits are equivalent to rotations. Optionally this method also takes a Tween or Thrust object. Tweens and Thrusts are carried out over the duration of multiple frames. Tweens stop at a predefined end value after a predefined time. Thrusts are carried out until canceled. >> The class reference elaborates on Tweens and Thrusts.

<camera>.orbitTo(x, y, z)
<sprite>.orbitTo(x, y, z)
<tag>.orbitTo(x, y, z)
<tag>.orbitTo(z)
  • x, y, z ... degrees around the various axis.

<camera>.orbitTo(tweenobj)
<sprite>.orbitTo(tweenobj)
<tag>.orbitTo(tweenobj)
  • tweenobj ... an object that describes the tween. Tween objects are usually instanced from classes that take x, y, z values and a time value that specifies the tween's duration.

Relevant examples: tag.py , sprite.py , tag_all.py , sprite_all.py , ALL

In Context

Immediate

def onSetup(self):
    self.camera.orbitTo(0.0, 15.0, 0.0)
s = ASpriteClass(self, 'sprite1')
s.orbitTo(0.0, 90.0, 0.0)
t = ATagClass(self, 'tag1')
t.orbitTo(180)

Tweens

def onSetup(self):
    self.camera.orbitTo(Tween(0.0, 180.0, 0.0, 2.0))
s = ASpriteClass(self, 'sprite1')
s.orbitTo(Tween(90.5, 0.0, 0.0, 2.0))
t = ATagClass(self, 'tag1')
t.orbitTo(SineTween(0.0, 0.0, 45.0, 2.0))
Initiated by Stephan Hechenberger
Thanks to CADRE's 103