I created a game but I made the game a little too big. It would be alot of hard work to shrink all the objects in the game and resize the stage using the properties. I notice that in debug mode the whole screen can shrink when you adjust the window. Is there some code I can use to this on it's own? and will it be costly on performance ??
A:
You can scale the stage, and by extension everything in it by setting:
stage.scaleX = 0.7;
stage.scaleY = 0.7;
This should hardly effect performance at all, unless you have a lot of bitmap graphics, which always is faster when it's at 1 to 1 pixel ratio.
grapefrukt
2010-02-06 17:18:54
well I am using bitmaps for tiling. so the background is a rendered bitmap
numerical25
2010-02-06 19:35:23
A:
You can just create a new Flash project of the new size, load the swf of your game (using the Loader class), and scale it using scaleX and scaleY properties. That way, you can also use this new swf as a preloader.
It might be costly on performances, depends on the number of DisplayObject you are using in your game. And you'll have to ensure that smoothing is activated on your bitmaps if you use some, if you want to avoid pretty horrible alisasing.
Zed-K
2010-02-06 17:22:22
I dont know how to make a preloader. that sounds like a good idea if alot of people do that already
numerical25
2010-02-07 18:15:15