Jens
Jens

Reputation: 47

AS3 Rotating MovieClip around specific point on stage, no matter where the MovieClip is

I'm making a game in flash sc6, air for android.

So let's say that my character is added to the stage at this position: character.x = 400; character.y = 200;

I have a MOUSE_DOWN function that moves the back ground (so it looks like the character is moving).

Now I want a function that, when it's triggered, makes the back ground rotate around the character.

It should be so that no matter what the coordinates of the back ground is, it should always rotate around the character (400, 200)

Has anyone got any information or answers to how to do this?? Any code would also be helpfull Thanks in advance :)

Upvotes: 0

Views: 194

Answers (1)

Velocirooster
Velocirooster

Reputation: 646

You're going to want to change the registration point of the background. This can be done using a simple transform matrix.

see AS3: setting registration point of a DisplayObject with actionscript?

Upvotes: 1

Related Questions