Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Scalable UI


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 schupf   Members   -  Reputation: 216

Like
0Likes
Like

Posted 28 May 2012 - 08:57 AM

Hello,

I have made a very basic UI system for my game. I basically just render textured quads and replace the textures for effects like "button hovering", "button pressing" etc.
The problem is: I design my button textures for a certain resolution. Lets say my game window is 1000x600 and a button has a size of 200x30. Now I create my button textures with a size of 200x30 and everything looks fine at resolution 1000x600. But when I increase the resolution (i.e. 1920x1200), the UI elements look too tiny. And when I scale the elements up, the elements look blurry.

Is there a common way to fix this? Right now the only simple solution I can think of is creating UI element sizes and textures for 2 resolutions and switch depending on window size (if < 1200x1000, use small elements, else big elements).

Thanks for any hints and ideas!

Sponsor:

#2 Tessellator   Members   -  Reputation: 644

Like
1Likes
Like

Posted 28 May 2012 - 09:14 AM

Creating multiple sets of assets at differing resolutions seems to be a fairly popular solution to the problem - I can't remember the game right now, but I know one popular (although fairly old) RTS did that.

The other thing you can try is to break your UI elements up into corner, edge and center pieces that you manipulate in different ways. This is often referred to as scale 9 (see here: http://jessewarden.c...ilverlight.html). It adds some complexity to things but is used in Flash regularly.

Depending on your UI style, you could create the entire thing from geometry and avoid bitmaps entirely. :)

T

#3 Digitalfragment   Members   -  Reputation: 869

Like
0Likes
Like

Posted 28 May 2012 - 05:53 PM

Generate fonts at the screen res you want at load time, if you are using bitmap fonts.
Personally i'm using DirectWrite/Direct2D, and so i'm using actual truetype files - so any resolution at any time is quite good.

For images, proceedural tricks work nice. Use of signed distance fields to preserve silhouettes while stretching images works well, check out this whitepaper: http://developer.amd.com/documentation/presentations/legacy/Chapter2-Green-Vector_Textures.pdf

If you create your images for the higher screen resolution though, when maintaining screen-size the texture will just by default fall back to lower mip levels. You dont even need to manually switch between textures for this.

#4 NickUdell   Members   -  Reputation: 288

Like
0Likes
Like

Posted 29 May 2012 - 06:14 AM

Could you create your UI textures catered for the maximum resolution you intend to support and then just scale the quads?

So instead of making your quad <200,300> make it <0.1*width,0.2*height>, which will keep every UI element the same size relative to the screen.

I suppose this could cause some distortion when it comes to text though, so be careful. It would certainly work for non-text situations.
Sole Creator of Pigment - a procedural, block-base space trading sim.

PhD student working on medical imaging at the University of Southampton.

Enjoyer of games, films, books and cider.

#5 EsorU   Members   -  Reputation: 112

Like
0Likes
Like

Posted 29 May 2012 - 02:56 PM

sry worng thread Posted Image

Edited by EsorU, 29 May 2012 - 02:59 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS