Sign in to follow this  
gameplayprogammer

Screen Resolution and images...

Recommended Posts

I am currently using 640 x 480 screen size in my game. I have just realized that there will not be enough room to fit all the text i want to fit on a screen( At a decent font size, from left to right). So do i start with the highest screen size i want my game to work in( 1024 X 768 )and design all the images with that in mind, then work back to accommodate lower screen sizes by resizing images?

Share this post


Link to post
Share on other sites
well, the size of your images shouldn't really come into play in the code much. Your caluclations should all preferbly done via scales. So the location of images etc could be done with local units.

So you might,

load in the image, getting size at same time
adjust for image aspect ratio
adjust for your scale ratio
then apply screen aspect ratio

your game should'nt care what size the image is, all it needs is to get the size to perform all its calculations.

And then you could either store 3 image sizes, (640, 800, 1024), and load the one depending on the user options for quality.

Or use just one size and resize it at runtme, (slow)

Share this post


Link to post
Share on other sites

a bit lost here...

adjust for image aspect ratio ?
adjust for your scale ratio ?
then apply screen aspect ratio ?

am right in thinking that you ask the computer you are running your game on it's screen resolution, and then pick the right size of images to display

example pseudocode....
if screen res is 800 x 600, then look in the 800 x 600 folder for the images

Share this post


Link to post
Share on other sites
Well, it all depends on how your mapping your images to the screen, the method i use is to map them to a poly plane, a square one.

adjust for image aspect ratio ? - the poly plane is square, so if our image is say 800x400, we need to adjust the scale of the poly plane, otherwise you will get stretching.

adjust for your scale ratio ? - the scale of the plane that you want to appear on screen.

then apply screen aspect ratio ? - if you create a poly plane, that is a square, and view it on a screen that is 1280x1280, it will appear square, if you view the plane on a screen of 1920x1080, it wont. This is because the screen gets mapped to -1 to 1 in x, and -1 to 1 in y. so it doesnt matter how much wider your screen res is over the height, they both still get mapped to -1 to 1. so you need to account for this, and scale both the image aspect and scale object by this new screen aspect.

(this is relating to directx btw)

The screen res the game is played it depends on the window size, which you allow the player to choose (create a list, from system specs), or pre define it, its up to you. And then you can use logic to test for the screen res chosen and then choose appropriate image sizes in your folder, or load the images to a different size on load up.


Hope that helps

Share this post


Link to post
Share on other sites
so my image sizes are refered to as width_units and height_units within my game.

an image 400 x 400 would be 400 width_units by 400 height_units

if screen res is 800 x 600
screen_aspect_ratio = 800/600

to find the absolute height of my image for this screen res i would multiply height_units by screen_aspect_ratio?

Am i right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this