Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have an XNA game, and when i run the game the textures load all good on my computer and on my tv and they're all bring drawn in the right position. But on my laptop, which screen is smaller then both my othe computers monitor and my tv screen, all the textures are being drawn way to large. Example: i have a background which is just grass, and a stone path, and the image size is 1920x1080. It loads fine and is centered on my other computer and TV, but on my laptop, its drawn way too big and where the center should be is in about the bottom right corner of the laptop screen. Is it possible to edit the code to make it resize better on smaller screens, or is it just my laptop and my laptop's screen size is messed up. I believe that my laptop is in the 16:9 aspect ratio.

Update 1

I have noticed that the textures load fine when the window is not in full screen, but in full screen the textures have problems. How should i change this Draw Method to fix this problem, and draw this in the right spot in a full screen 1920x1080 window?

spriteBatch.Draw(backgroundTexture, Vector.Zero, Color.White);

(keep in mind the backgroundTexture is 1920x1080)

share|improve this question

2 Answers 2

Depending on what function you call, you can probably resize the image correspondingly to diffrent resolution. This is a common problem, and is often solved with dynamic screen scalings. To just take this problem one step futher, you need to do dynamic correction with your GUI to maintaint the correct layout over all possible screens.

and assuming you are using the Spritebatch::Draw function, there is a parameter called rectangle. The width & height i suppose will be equal to the device screen cordinates. not to the texture size.

share|improve this answer

I provided a answer to a similar question XNA - move camera over tilemap

you need to pass the resultant Matrix to the spritebatch.Begin()

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.