Hot answers tagged

80 votes
Accepted

What is the difference between a HUD and a GUI in a game?

I'd argue that HUDs are graphical user interfaces: they're ways to present information back to the user graphically. In contrast to what some other answers say, the term GUI doesn't require that ...
user avatar
  • 114k
26 votes

What is the difference between a HUD and a GUI in a game?

Interactivity. A HUD is not interactive: it displays information only, it cannot be clicked, dragged, closed, etc. A GUI in a game is like any other UI: it is interactive. It has menus, buttons, ...
user avatar
  • 3,679
23 votes
Accepted

Unity new UI - Dynamically change the functions called by GUI elements

There's a super simple way to change events: EDIT See my other answer for the quick and easy way to add an event for the OnClick event only. For other events, ...
user avatar
  • 72.7k
19 votes
Accepted

How to match font size with screen resolution?

It's easy: Fonts do not need to match resolution, they need to match pixel density. Pixel density is measured as pixels per inch(PPI), or pixels per centimeter. There's also a measure unit called ...
user avatar
16 votes
Accepted

Button stays highlighted after being clicked - Unity3D 4.6 GUI

The Navigation property of buttons is set to Automatic by default, allowing you to navigate through buttons using arrow keys. ...
user avatar
15 votes
Accepted

Unity UI square that fills width OR height

Finally I found a way to do it (tested in v5.0.0), in a way that: Does not need code, or conditionals to check orientation. Does not hack with scales and neither needs a reference resolution. In the ...
user avatar
  • 1,033
13 votes

How to create gui image with script

Its entirely possible. Here's a simple script showing how. ...
user avatar
12 votes
Accepted

How to detect mouse over for UI image in Unity 5?

You can implement IPointerEnter and IPointerExit interfaces and keep boolean for 'over state': ...
user avatar
  • 655
12 votes
Accepted

How to make curved GUI in Unity?

Here's a strategy for making arbitrarily bent UI: we'll render our UI into a texture (in realtime, not as a baking step), and then map that texture onto whatever mesh we want. Here's how I made this ...
user avatar
  • 114k
12 votes
Accepted

Running into issues with Unity Vertical Layout Group

Alright my dude. Welcome to the hell that is layout groups. Here's a few things you'll need to know first: If nothing is sizing the object, the layout group will not work as you expect (in fact it ...
user avatar
  • 631
11 votes

Unity new UI - Dynamically change the functions called by GUI elements

The word is that the delegate{} syntax found in my previous answer is obsolete, there is another way of doing this using lambda notation: ...
user avatar
  • 72.7k
11 votes
Accepted

How can I round out the corners of a quad in OpenGL?

This is not technically an answer to your question, but is a better work around in my opinion. You can pass the dimensions of the boxes and the radius of the corners to the fragment shaders and round ...
user avatar
  • 14.5k
11 votes

In OpenGL, is it a bad idea to "combine" immediate mode and retained mode for the sake of GUIs?

I personally only see it as being bad for two reasons: It is very outdated and deprecated. And, It is much slower than the modern ways of drawing with OpenGL. But, if it's working out, and ...
user avatar
  • 132
9 votes
Accepted

How to dynamically create an UI text Object in Unity 5?

I think what you are looking for is something like following: ...
user avatar
  • 4,885
8 votes

Changing color of UI Text in Unity into custom values

You can do this with the code below: title.color = new Color(254.0f/255.0f, 152.0f/255.0f, 203.0f/255.0f);
user avatar
8 votes
Accepted

In OpenGL, is it a bad idea to "combine" immediate mode and retained mode for the sake of GUIs?

It is a bad idea insofar as it is nonsensical. There is nothing to "set up" that you have not already done, except for an ortho projection matrix (which you will have to do in any case). Portability ...
user avatar
  • 1,354
7 votes
Accepted

How to make a scrollbar?

Let's call the content you want to scroll content and the viewable area of that content viewPort. Your ...
user avatar
  • 206
7 votes

UNITY : I want to make my UI text fade in after 5 seconds

Here is a rather simple extension class that you can use. ...
user avatar
  • 2,965
6 votes
Accepted

How to show a float with no decimals

Don't forget that every object in .NET has a ToString() method. Many of the built-in value types accept an optional formatting argument; numeric types in particular ...
user avatar
  • 726
6 votes
Accepted

Custom Editor - keep default look but add more

Call this function from inside OnInspectorGUI method to draw the automatic inspector. It is useful you don't want to redo the entire inspector, but you want to add a few buttons to it. http://docs....
user avatar
6 votes
Accepted

How do I set the exact local position of a RectTransform?

First of all, ensure you set the parent before setting local position, then, you have two options according to the type of Rect Transform : non-stretching and stretching ones. For a non-stretching ...
user avatar
  • 2,919
6 votes
Accepted

How can I render an OpenGL scene into an ImGui window?

First you need to render you scene to a Frame Buffer Object (here is a good course on FBO: https://learnopengl.com/#!Advanced-OpenGL/Framebuffers) After that you will end up with a Texture (of type ...
user avatar
  • 362
6 votes
Accepted

How can I apply a Camera Shader to UI?

The default behavior for Unity's UI is to draw after the post-processing effects have been applied. This is dictated by the Render Mode setting on your scene's <...
user avatar
  • 1,351
6 votes

What is the difference between a HUD and a GUI in a game?

Is a HUD part of the GUI and just displaying information? Yes. Head Up Display (as the name suggests) is just to display information while you are in-game. However in some scenarios HUD may be ...
user avatar
  • 236
5 votes
Accepted

Entity/Component System and UI "Entities"

After using several entity-component systems, especially CraftyJS, I more or less got the answer to my question: yes, you can reuse components (especially sprites or images and mouse-click handlers in ...
user avatar
  • 11.3k
5 votes

How can I create a button with an image in libGDX?

You have the freedom to create your own button class, attach to it a sprite, make some methods to handle input and you're good to go. ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible