Jump to content
  • Advertisement
Sign in to follow this  

Two unrelated 2D game development questions

This topic is 4098 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing this game using DirectX 9 in C#. I have two questions. Question 1: My game, in it's current form, is in a window. The way things are setup, all the 2D sprites are of fixed size. This means if the window is shrunk, it simply hides part of display. I want to change this so that it shrinks the display. IE: Everything scales down so the entire 'view' is still there, just smaller. At first I was thinking I would have to go through each sprite and apply some kind of global scaling, but then I thought that was probably a really stupid way to do it. I am betting there is some kind of global matrix that is applied to everything I can set. This would solve two problems: The first being a shrinking window (or growing one) would still display 100% of the game. The second being, I could 'calibrate' my game for 800 x 600 (or some other resolution) and then just apply a scale factor to match the real resolution. For example, I could just say, I want the HUD health bar to be from 200, 20 to 300, 20 on an 800x600 screen, and then it would automatically end up in the right relative spot even if you switched to 1920 x 1200. I just need to know how to set the global matrix that will scale everything for me. Question 2: When designing a game with a HUD and I am relegating my play area to certain section, should I use multiple view ports or should I just stick with one? For example, on the 800x600 screen, if the 'action' area of the game goes from 0,0 to 600x600 and the HUD is in area 600,0 to 800,600, should I use two view ports or just one? I am thinking I should just use one, but then manually bound various sprites, such as bullets. IE: When a bullet's x coordinate is > 600, then do not draw it.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!