Games/Application (Video output, Frame, Graphics Components,Versatility)
im about to finish the game project that im writing with this past few months [-O< , as of the moment, its working properly and for a few weeks im about to have a project defense on my school, thanks to those people here who helped me alot, thanks so much
now i want to ask a question that could be usefull in my future developments, especially with this game,
my game is developed with in component(Frame) JFrame, setting its size , dimensions etc, in common way using its methods,
my question is about versatility, what would be the best way to make my application's frame versatile, for example:
no matter what size of screen(monitor) my frame(My application) will have a dimension relatively to it. it will adjust its size, because before this is my major problem, i was developing an application in my 17' inch monitor, everything was fine, but when i deployed it in a smaller size, it looks awful, i just want to have a guideline how can it be possible to my applications to adjust itself (size/dimension/resolution) to what ever type of environment it will be. i was able to do something to compensate with it using the Toolkit, getting the monitors size, subtracting and adding some numbers on the frame
Maybe the good question will be the ff:
1.) Is there a better way?
2.) Classes to be used
3.) where should i start searching and studying
sorry for the bad english , i hope you understand my thought, any corrections will be appreciated. thanks
Re: Games/Application (Video output, Frame, Graphics Components,Versatility)
If you want your app to size correctly according to the screen resolution size (not the same as its physical dimensions), use Toolkit.getScreenSize(), and size your main frame appropriately. If you use suitable layouts for the components within the main frame, they will automatically position and size the components.
Re: Games/Application (Video output, Frame, Graphics Components,Versatility)
how about the images ive drawn, for example i created 100x50 image and it suits in my LCD, it will be small in a bigger screen..
i encountered a Graphics Environment/devices classes, will it do some adjustment when my application is run in a wider screen?
Re: Games/Application (Video output, Frame, Graphics Components,Versatility)
There is an argument against doing that, actually. Some users aren't going to want you to change your window based on their screen size or resolution- in theory, they have it set up that way because that's how they want it, and it sort-of goes against Java's ideals (in my humble opinion, anyway) to work around them. If a user wants your window to be bigger, the user can either change the screen resolution or the frame size.
It might even be impossible to fully work around- you can get the screen's resolution, but not its physical size. And without that, you can't know how big your frame actually is.
That being said, what you could do is look at how your images are being downscaled. Or you could just allow the user to resize the JFrame at will- you might have to do something to keep the proper aspect ratio (or not), but it will give the user the most freedom.