orbitBy()

Orbits an element by x, y, z around the corresponding axis relative to the element's current rotation. Orbits 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>.orbitBy(x, y, z)
<sprite>.orbitBy(x, y, z)
<tag>.orbitBy(x, y, z)
<tag>.orbitBy(z)
  • x, y, z ... degrees around the various axis.

<camera>.orbitBy(tweenobj)
<sprite>.orbitBy(tweenobj)
<tag>.orbitBy(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.

<camera>.orbitBy(thrustobj)
<sprite>.orbitBy(thrustobj)
<tag>.orbitBy(thrustobj)
  • thrustobj ... an object that describes the thrust. Thrust objects are usually instanced from classes that take x, y, z values. The standard Thrust understands them as change/second.

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

In Context

Immediate

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

Tweens

def onSetup(self):
    self.camera.orbitBy(Tween(0.0, 90.0, 0.0, 2.0))
s = ASpriteClass(self, 'sprite1')
s.orbitBy(Tween(90.5, 0.0, 0.0, 2.0))
t = ATagClass(self, 'tag1')
t.orbitBy(SineTween(0.0, 0.0, 45.0, 2.0))

Thrusts

def onSetup(self):
    self.camera.orbitBy(Thrust(0.0, 45.0, 0.0))
s = ASpriteClass(self, 'sprite1')
s.orbitBy(Thrust(30.0, 0.0, 0.0))
t = ATagClass(self, 'tag1')
t.orbitBy(FadeinThrust(30.5, 0.0, 0.0))
Initiated by Stephan Hechenberger
Thanks to CADRE's 103