Flashplayer window size question


(Kitheif) #1

Just playing around with FP, I was wondering about what people do when they play their project with FlashDevelop and the Flashplayer window is larger than the game window and it does this.

I can simply change the window size for Flashplayer but do I really need to do that every time I run my game?

Thanks for any tips in advanced!

KiTheif


(Jonathan Stoler) #2

(Note: I don’t use FlashDevelop, but I’m pretty sure this is your problem!)

In your Main class (or whatever equivalent you have - basically the first thing that’s loaded), you need to insert the following above the class declaration itself:

[SWF(width="400", height="400", backgroundColor="#000000"]

Obviously, replace the 400's with whatever width/height you want, and you can change the background color as well.


(Zachary Lewis) #3

If you’re using FlashDevelop, you can set these properties in your project if it’s easier for you.

You’ll want to go to ProjectProperties… and change the Dimensions.

@JonathanStoler’s method will also work (and is 100% cross-platform).

Bear in mind that if your game is 200x200 but you’ve set FP.screen.scale = 2, you’ll need to set your height and width to 400x400.


(Kitheif) #4

Ahh thank you both very much!