moveTo()

Moves an element to x, y, z in the coordinate system of the parent element. Optionally this method also takes a Tween object. Tweens are carried out over the duration of multiple frames. >> The class reference elaborates on Tweens.

<camera>.moveTo(x, y, z)
<sprite>.moveTo(x, y, z)
<tag>.moveTo(x, y, z)
<tag>.moveTo(x, y)
  • x, y, z ... coordinates in 3D space

<camera>.moveTo(tweenobj)
<sprite>.moveTo(tweenobj)
<tag>.moveTo(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.moveTo(0.0, 0.0, -5.0)
s = ASpriteClass(self, 'sprite1')
s.moveTo(-0.5, 0.0, -1.5)
t = ATagClass(self, 'tag1')
t.moveTo(200, 50)

Tweens

s = ASpriteClass(self, 'sprite1')
s.moveTo(Tween(2.5, 0.0, 0.0, 2.0))
t = ATagClass(self, 'tag1')
t.moveTo(SineTween(50, 10, 0, 2.0))
Initiated by Stephan Hechenberger
Thanks to CADRE's 103