Jump to content
  • Advertisement
Sign in to follow this  

Scalable UI Elements

This topic is 3619 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

Hey all, I'm in the process of thinking out a UI system for my game. I'm pretty comfortable with most of it, but one thing I'm unsure about. Say I want to make a form (like a windows form), this can be any size. Big, small, any aspect ratio.. whatever. I cannot simply map a texture over the required size because it will stretch and look bad. Also the borders should remain the same distance from the form's edge, and button's must remain in place. Now I see a few options.
1. Go right down to basics and draw each form to its specifications - no textures
 - purely OpenGL generated graphics. This doesn't seem too efficient or flexible.

2. Have a basic (cant tell if it's stretched) background texture, and several 
frame segment textures ( one for each stretch axis ), and then 'assemble' each form.

3. Suck it up and map a generic frame texture to each form.
I like number 2. I'm unsure about its efficiency and practicality though and wondered if anyone had suggestions/improvements etc. I'd rather create my own instead of using a library, I need to learn it at some point, might as well be now. Thanks,

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!