Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Fitting Screen Resolution to In-Game Drawables  (Read 3894 times)

0 Members and 1 Guest are viewing this topic.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Fitting Screen Resolution to In-Game Drawables
« on: January 10, 2011, 05:22:34 am »
I need to find a way to make my in-game drawables conform to the screen-resolution or aspect ratio of any computer screen that it runs on.
Right now everything on my menu stays perfectly in place when run on other computer because everything is perfectly centered, but I'd like to start putting things off-center. If anyone has any ideas, please reply. :D Thanks
-Wander

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Fitting Screen Resolution to In-Game Drawables
« Reply #1 on: January 10, 2011, 05:34:42 am »
I don't understand what you need help with.  If you are able to draw things in the center then you should also be able to draw them other places :)

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Fitting Screen Resolution to In-Game Drawables
« Reply #2 on: January 10, 2011, 05:41:46 am »
What about when the resolution changes? If I draw everything relative to the center of the screen then the edges of the screen will be left blank when the screen gets too big for the images and vice versa.
-Wander

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Fitting Screen Resolution to In-Game Drawables
« Reply #3 on: January 10, 2011, 06:02:24 am »
Oh I see what you mean.

You could scale the images based on the size of the window, but odds are your graphics would start to look bad at some point.  You could also just fix the size of the window or give the user a set of pre-selected options that you know you can deal with and let them choose one.  Or you could just use a Clear() color that looks ok with the rest of what you are drawing and let space appear around your drawing if the user insists on make the window a lot bigger.  Kind of depends on what you ultimately want the user to be able to do.  I'm sure other people have some better suggestions.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Fitting Screen Resolution to In-Game Drawables
« Reply #4 on: January 10, 2011, 06:05:30 am »
Well, seeing as its an RTS and the user has to be able to pan the map by hovering around the edge of the screen I will need to take up the window.
-Wander

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Fitting Screen Resolution to In-Game Drawables
« Reply #5 on: January 10, 2011, 06:11:56 am »
What do you mean by take up the window?  If you just need pan the screen then when the mouse is at the edge of the screen (or some area you specify) just move the view in that direction.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Fitting Screen Resolution to In-Game Drawables
« Reply #6 on: January 10, 2011, 06:14:06 am »
By take up the screen I mean that the graphics that are drawn will need to go to the edge of the screen. I know that they don't necessarily HAVE to go to the edge, but it would seem a little awkward to be going off of the playing screen to move the map around.
-Wander

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Fitting Screen Resolution to In-Game Drawables
« Reply #7 on: January 10, 2011, 06:24:52 am »
Well if the map/graphics don't extend past the current view then they wouldn't need to pan anyway :)

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Fitting Screen Resolution to In-Game Drawables
« Reply #8 on: January 10, 2011, 06:28:55 am »
Ah, but they do. Haha
-Wander

 

anything