View Full Version : Scope Zoom
Vagabond
02-26-2009, 06:41 PM
Is there a simple way to make a faux zoom inside an on-screen scope?
I don't want to make a zoom function or anything, I just want to make the area inside the target cross hairs magnified a little bit to simulate a scope.
EightySeven
02-26-2009, 07:06 PM
The first thing that comes to my mind is 2 sets of MCs one regular sized, one magnified. and then use the scope to mask the regular so you can view the magnified one.
But I'm sure there is a much better way to do it, as i said thats the first thing that comes to my mind
bluemagica
02-27-2009, 02:43 AM
yep thats the best way.....use a mask, to show a pre-enlarged mc!
I was playing around this some time back, and i did it by actually enlarging the base movieclip and then moving it around depending on the distance of the scope to the stage origin...
Vagabond
02-27-2009, 03:04 AM
Most elements on the stage are going to be random. The position of the trees and bushes, and where and when the targets appear.
I figure I can make a ghost MC where every element is set dependent on the exact locations of each element on the base mcs, but this is starting to sound a little complicated.
Vagabond
02-27-2009, 08:31 AM
It's be a nice little element, but I think I'm getting ahead of my skill and the scope of the game. I'd love to do it, but it's just icing, not actually necessary to the game.
Thanks for the replies though ^^
Yeah I've thought about this before and that's the only solution I've thought of.
You need to really think about the structure of your game and how you would check what is visible and thus needs to be duplicated and what does not need to be duplicated.
Added: I think you might be able to pull it off with a bitmap.
var bData:BitmapData = new BitmapData(300,300);
var scaleM:Matrix = new Matrix();
scaleM.scale(4, 4); //scales it up
scaleM.translate(-200,-300); //shifts it over
bData.draw(thingMoe,scaleM);
var scope:Bitmap = new Bitmap(bData);
addChild(scope);
Vagabond
03-04-2009, 05:26 AM
Unfortunately, I'm not that savvy just yet =_=\
Would you mind going into a little more detail as to what each of those lines do?
thingMoe is the background movieclip that I wanted to scale up. Scope is the resulting thing I want to display. It'll be square, rather than round, so you'd still need to apply a mask to it.
The Matrix object is being used to transform the image when drawn to the bitmap using the .draw method. In this case, it's making it 4 times the size and then shifting it over 200x and 300y. You'd want to tie the distance it shifts over to the position of the scope.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.