Forum Topic: "Zoom on" with AS

(94 views • 5 replies)

This topic is 1 page long.

<< < > >>
Expressionless

Toady1104

Reply To Post Reply & Quote

Posted at: 6/15/09 07:38 PM

Toady1104 LIGHT LEVEL 14

Sign-Up: 07/02/06

Posts: 107

I can move the "camera" horizontally by setting the "x" of the stage and vertically by setting its "y", but how do I "zoom" the camera? I tried "z", which is the more logical one and it don't works. :/


None

Healthy

Reply To Post Reply & Quote

Posted at: 6/15/09 07:43 PM

Healthy FAB LEVEL 15

Sign-Up: 06/16/07

Posts: 1,063

You could do _root._xscale++ or _root._yscale++but that's terrible practice. I would put all the movieClips in one container and just modify that container.

BBS Signature

None

liaaaam

Reply To Post Reply & Quote

Posted at: 6/15/09 07:43 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,502

You can change the scale of the stage by using scaleX and scaleY.


None

Toady1104

Reply To Post Reply & Quote

Posted at: 6/15/09 09:11 PM

Toady1104 LIGHT LEVEL 14

Sign-Up: 07/02/06

Posts: 107

At 6/15/09 07:43 PM, Healthy wrote: You could do _root._xscale++ or _root._yscale++but that's terrible practice. I would put all the movieClips in one container and just modify that container.

Im using AS 3.0 and scaleX ++ works, now Im just having a little problem with centralization...
Also why is it a bad practice?
All I will do with it is zoom in when the character is aiming and then go back to normal so it shouldn't be a problem.


None

Afro-Ninja

Reply To Post Reply & Quote

Posted at: 6/15/09 09:24 PM

Afro-Ninja EVIL LEVEL 37

Sign-Up: 03/02/02

Posts: 13,466

At 6/15/09 09:11 PM, Toady1104 wrote: Im using AS 3.0 and scaleX ++ works, now Im just having a little problem with centralization...
Also why is it a bad practice?
All I will do with it is zoom in when the character is aiming and then go back to normal so it shouldn't be a problem.

The coordinates of the stage/root are based in the upper left, that's where 0,0 is to flash. The x and y axis extend down and to the right in the positive

As you zoom in you need to examine what point you're zooming to and adjust the actual x/y position of the stage to offset the shift the zoom causes, you would have to do this for any case where your zoom target isn't centered in the middle of the screen

BBS Signature

Resigned

LenardNotLenny

Reply To Post Reply & Quote

Posted at: 6/15/09 09:50 PM

LenardNotLenny LIGHT LEVEL 16

Sign-Up: 10/31/07

Posts: 480

Or you could just use a vcam.

I like to rape children

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 08:51 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!