#1 Crossbones+ - Reputation: 2472
Posted 29 October 2012 - 04:14 PM
Normally, we would use a sprite sheet to setup basic animations of the elements but in doing so we have caused one frame to bleed into the other. We want something like the Dragon Age UI or Dragon Age 2... these were both very clean and very powerful. Any thoughts on how best we can achieve this?
My game project blog.
#2 Members - Reputation: 635
Posted 29 October 2012 - 08:25 PM
I created a set of textures that the window will use. Including
- The top-left corner border
- The top-right corner border
- The bottom-left corner border
- The bottom-right corner border
- Horizontal border (for the top and bottom parts of the window)
- Vertical border (for the left and right parts of the window).
I'm not completely sure this it what you want but anyway.
Xanather.
#3 Crossbones+ - Reputation: 2472
Posted 29 October 2012 - 10:14 PM
My game project blog.
#4 Members - Reputation: 635
Posted 29 October 2012 - 10:37 PM
Your UI seems to be a bit more sophisticated though, and creating events instead of updating the elements within a other element every update would probably be more efficient.
#5 Members - Reputation: 560
Posted 30 October 2012 - 06:58 AM
As Xanather mentioned, box 9 or 9 quad or what ever it is called is a very nice method for ui window construction, allowing windows to stretch without distortion. I'm sure something similar could be done for basic circles, but i have a feeling you want something more organic than that.
Resizing from a control is as easy as calling window.resize(), howeve, implementing resize() that will work in multi resolutions, will require a layer of abstraction, using a virtual coordinate system(or just make the entire thing in NDC space).
There was a really good article on here a while back, about making a custum ui... I'm sure you can still find it here somewhere. Basically all windows and controls are decendents of a base class, and each is a node in a linked list of windows/controls that are drawn from bottom up. When you resize your window, it can pass the resize info down to it's children, as well as to it's siblings, so that they maybe adjusted in turn.
#6 Crossbones+ - Reputation: 2472
Posted 30 October 2012 - 07:24 AM
My game project blog.
#7 Members - Reputation: 427
Posted 30 October 2012 - 08:22 AM
I guess our major concern is really scaling of the images when you increase or reduce the resolution size. For the most part, that is.
Unless you generate the graphics on the fly, you're not going to be able to scale them infinitely. What Xanather mentioned is the standard way of achieving scalability for rasterized rectangles. Other than that, I would render to an OpenGL surface or image file using Cairo (or similar):
So why would you want to mix vector-graphics rendering, provided by cairo, with OpenGL in the first place?...
- Create pristine texture-maps, which are resolution-independent and combine those with your custom mip-mapping.
- Have animated vector-graphics as head-up-displays or overlays in your OpenGL-program.
Edited by nox_pp, 30 October 2012 - 08:23 AM.
#8 Crossbones+ - Reputation: 2472
Posted 30 October 2012 - 08:56 AM
My game project blog.
#9 Members - Reputation: 553
Posted 30 October 2012 - 09:38 AM
You mentioned WoW, which even has a slider bar for 'Adjust UI Scale'. I'm pretty sure they have a set of fixed resolution UI elements (something fairly large), and just scale them in game with some standard texture filtering. Unless you a need pixel perfect UI, I think this is completely acceptable.I guess our major concern is really scaling of the images when you increase or reduce the resolution size. For the most part, that is.
Upscaling is probably the biggest concern, so you can create fairly large resolution widgets and keep them in memory, and downscaling those images shouldn't lose too much visual fidelity. If you're really concerned with supporting ranges of say 800x600 to 1920x1080 (and if a single resolution UI set isn't acceptable), you could create multiple sets of your UI with varying resolutions, and apply the appropriate one when the user chooses their screen resolution.
Xanather has the correct solution for applying textures to scaleable windows.
#10 Crossbones+ - Reputation: 2472
Posted 30 October 2012 - 09:58 AM
My game project blog.
#11 Members - Reputation: 1226
Posted 30 October 2012 - 10:25 AM
Might be a better idea if the borders have lots of intricate detail.
Can look a bit weird for the user if windows are dynamically resizable by the user though.
UIs generally does not play nice when scaled down, so if your problem is the low end of the resolutions, you might have to think about having different, lower res, decorations at lower resolution. (or just accept it doesn't look "perfect" and realize not many of your customers will have that experience anyhow, so maybe not so important to spend time on)
If the UI is very complicated, you might need different layout too, but as long as the screen has roughly the same apect ratio (doesn have portrait mode or such like mobile devices), you probably can create a layout that works for all.
Edited by Olof Hedman, 30 October 2012 - 10:27 AM.
#12 Crossbones+ - Reputation: 2472
Posted 30 October 2012 - 11:04 AM
My game project blog.
#13 Members - Reputation: 369
Posted 31 October 2012 - 11:43 AM
You may also want to check out Signed Distance Fields (nice video here, original article here). Compositing several distance fields together with effects like gradients could give a fairly wide range of scalability at low runtime cost.






