Sign in to follow this  
Haptic

Scalable UI Elements

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this