Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Scalable UI

4: Adsense

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   


Posted 28 May 2012 - 08:57 AM


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!

#2 Tessellator   Members   


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. :)


#3 Digitalfragment   Members   


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   


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   


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.