Sign in to follow this  

Screen size conundrum

Recommended Posts

Hi guys,

I am currently writing a simple 2D plaformer with sprites in DirectX9.

At the moment I have the sprites positioned in 'screen space'. So, there is an obvious problem of having the render window look the same on different screen resolution. My dev rig is displaying at 1600 x 900 so I have been working around that at the moment.

So, when I run the app from a TV screen the sprites appear smaller than my dev rig (as expected).

I thought of using a normal 3D camera system and set the FOV and position the camera a fixed distance from the scene. But, I dont want the 'warping' of the sprites that the 3D perspective will be (i.e. a perfect square will be rectangular from the edge of the scene).

I then looked into the Ortho camera system, but it seems to require window sizes in pixels. So, I think that uning ortho will give me the same issue I allready have.

Any idea how I might tackle this issue? So, I am after standard size sprites that are sized relative to screen size.

Thanks in advance!

Share this post

Link to post
Share on other sites
I would still use an orthographic camera to show your sprites, but figure out a target resolution you'd like to display at. Use that as your dimensions, and then you can scale the sprites by the difference between the target resolution and the physical resolution.

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