Graphical User Interface. A term used to describe the tools available to the player to interact with the game.
0
votes
2answers
56 views
How to resize a button without resizing its text
I think it is done with the Anchors of the Rect Transform. I have tried all the possible combinations of the following default anchors:
Unfortunately, when I resize the button in the Scene, the ...
1
vote
1answer
34 views
Creating a GUI Countdown Timer Unity5
This was originally posted as a follow-up comment to http://stackoverflow.com/questions/30714357/guitext-in-unity-5-need-an-alternative , but I'm asking it here as a dedicated question as per the ...
0
votes
2answers
69 views
Unity 5 Dynamic Button Creation with Event Parameters
According to the documentation, you cannot instantiate buttons except via prefab instantiate.
http://docs.unity3d.com/Manual/HOWTO-UICreateFromScripting.html
You might wonder why we don’t have a ...
0
votes
2answers
32 views
How to detect mouse over for UI image in Unity 5?
I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
0
votes
0answers
27 views
Unity 2D - GUI box not moving with game object on X axis
I am trying to create a health bar above a spaceship in a 2d spaceshooter. Right now I just need to create a box and move it with the player. I found WorldToScreenPoint() which should work althought ...
2
votes
3answers
100 views
How to create in game menu attached to unit
I'm creating a game similar to Banner Saga, except my game will be in 3D, with a camera that can move around and zoom in and out. What I want is for a menu to appear after the user clicks on a unit. ...
0
votes
1answer
25 views
How do I know what button was clicked? (Unity)
I have a prefabbed button (UI.Button) which I'm instantiating ten times:
public void LayoutButtons() {
GameObject newCanvas = Instantiate (canvas) as GameObject;
for (int i = 0; i < 10; ...
1
vote
1answer
42 views
Why does Forge not find my texture for my custom background?
I am creating a minecraft mod that improves the main menu for my minecraft server. At first I wanted to create the background, but somehow when I try to start minecraft it closes and I get a ...
1
vote
3answers
86 views
Why does a UI button that is child to a canvas not appear in game view?
I am trying to place a button onto a canvas background using C# script.
I want the button specific to the canvas (i.e., if I move the camera to look at another canvas, I do not want the button ...
0
votes
1answer
43 views
Can't see instantiated UI element
I'm trying to create a level editor for a 2D game and I wanted to instantiate radio buttons, the backgrounds and numbers of which are determined by the tilesheet I load.
I'm sure I'm doing something ...
0
votes
0answers
48 views
UI Element in World Space OverrideSorting
Let me explain my problem.
From a database I create buttons (around 40) in a World Space.
The problem is that some buttons are displayed in front of other. (screenshot)
Personally I would like the ...
2
votes
1answer
57 views
Keeping Android device awake [closed]
I currently program a game in which the user don't need to interact with the screen. Is there any way to keep the screen awake?
0
votes
1answer
42 views
My GUI stopped working?
Okay I bought this asset online so I would like not to show the whole script. The problem is this asset stopped working when I updated from unity 5.0 to 5.1.2. The script is for a controller GUI ...
1
vote
2answers
95 views
How do I refer to the object that called a function?
I have a large number of buttons instantiated from a prefab using a loop, as follows:
public void LayoutButtons() {
GameObject newCanvas = Instantiate (canvas) as GameObject;
for ...
0
votes
2answers
31 views
LibGdx TextButtonStyle Offset not working correctly
I'm intending to give an animation to the TextButton by giving the pressedOffsetX and pressedOffsetY values:
TextButtonStyle buttonStyle = new TextButtonStyle();
buttonStyle.font = font25;
...
1
vote
2answers
71 views
Should input be per-frame or per-update?
I'm implementing a GUI system to look around a 2D tile-based world. At the moment, I'm updating it every time the mouse moves (which happens to be per frame, since that's when it polls for events). ...
2
votes
1answer
48 views
Need help with making a journal system
My game uses a system similar to Metroid Prime's logbook, in that it logs things the player encounters and discovers on their journey, categorizing it, etc.
I want to write out all of the possible ...
1
vote
1answer
37 views
How do I duplicate the functionality of ugui's onClick (button component) in inspector (Unity)?
I'm trying to create the same functionality that occurs when you are working with a button in uGui in Unity. I know that I have to create a custom inspector, but i'm not sure where to go from there.
...
0
votes
1answer
45 views
Adding a function call to a prefabbed button in Unity
For each of my scenes, I have an empty GameObject _Manager that stores my scripts for setting up the level, keeping track of variables, etc.
On my main screen, I have a play button that isn't ...
0
votes
2answers
269 views
What are the steps to instantiate a button in Unity?
Given a Canvas test_canvas containing a Button test_button and an empty GameObject that manages instantiation and scripts and the like called test_manager, what are the steps to instantiate this ...
0
votes
1answer
57 views
Unable to Set Text of another Text Object
The Idea: Pressing a button in the canvas will allow the player to select a race. A script is attached to an object which is accessed though the OnClick() function of the button.
The script is ...
1
vote
2answers
206 views
Swing GUI for games (performance)
I'm developing a game in Slick2D and I'm trying to make GUI.
I've already tried TWL library, but it seems to me a bit complicated and it doesn't cover what I need. In my own implementation of GUI ...
0
votes
0answers
19 views
Resizable textured windows
I want to have display a window with a textured background, but the window should be resizable.
How would you recommend going about this?
Using a 9-sliced image for the background will not work ...
2
votes
1answer
191 views
Unity Grid Layout causing multiple draw calls
We are developing a game in Unity 4.6.6 for both Android and iOS.
Currently I am building the game UI with the new Unity UI system. In particular I am building a button list to create kind of ...
1
vote
3answers
288 views
In Unity, how do I make separate mute buttons for sound-effects and music?
I'd like to have a button to mute game sounds and another to stop the game music. How can I do this?
0
votes
1answer
109 views
How to Reciprocally draw on a 3D mesh and 2D UI Image in Unity?
My question is a bit involved so I'm going to split it into parts and attach a picture.
1) In Unity I'd like to be able to draw a line on a 3D worldspace mesh with the mouse.
2) As I'm drawing on ...
3
votes
1answer
101 views
How do I use Libgdx viewport for UI?
I am using LibGDX to make a game for Android and I am using 2 Viewports. One for UI and one for the actual game content. My problem is I can't find a good way to scale my UI using a Viewport.
This ...
1
vote
1answer
326 views
How to create gui image with script
So I've been fiddling around with the new UI system recently -- and one problem I have is adding images of my sprites to the ui.
I know I can create a prefab of an image gameobject with the sprite ...
2
votes
1answer
169 views
GetButtonDown for Unity keyboard UI navigation?
By default, Unity's keyboard navigation for buttons seems to check for GetButton rather than GetButtonDown--if a menu has 5 items and I hold the down arrow, it'll scroll very quickly to the bottom.
...
1
vote
1answer
76 views
Raycast, UI and Update Question
I have movable objects in a scene. When Raycast hits an object, I have a hovering UI that moves to a retaliative distance from the hit object. When the object is dragged, the UI's position is moved ...
0
votes
0answers
35 views
A panel to change 3d object properties when right click on it (Unity)
I'm building a UI system to edit selected 3D objects. I have spheres on the screen and I want to be able to edit their proprieties (radius for example). In order to do that I want the user to be able ...
1
vote
1answer
169 views
What would cause my script generated buttons and text to show in Unity and not on my phone?
I am using Unity 5 and the built in GUI tools. My static GUI shows up just fine which makes me think it's not a text/font issue or some such. Again, it all looks good in the Unity editor when I hit ...
0
votes
0answers
83 views
Unity - UI Mobile - Script Generated buttons/text not seen?
I'm trying to generate some buttons and text dynamically with Unity 5.0 All of my code seems proper. It looks great when I play it in the editor. Everything is generated and placed and sized as I want ...
0
votes
0answers
100 views
Rich Text on InputField breaks Content Size Fitter functionality. Need some help
I'm currently using the input field as a way to make normal(ish) text in Unity. Refer to this question for more detail: How do I go about making a text box that allows for highlight-able and copyable ...
1
vote
1answer
121 views
How do I go about making a text box that allows for highlight-able and copyable text in the new UI?
I'm trying to make a simple chat system for our games lobby, however I am having issues making a text box that allows for text-highlighting. The Text component does not have interactible text, and the ...
6
votes
1answer
99 views
Custom Editor - keep default look but add more
What I would like to know is if there is a easy way using OnInspectorGUI, to replace the inspector with one that includes just one or two additional fields (so that it looks identical to the ...
0
votes
1answer
58 views
Legacy GUI - run OnGUI only once
I remember something about onGui being able to be run multiple times per frame, and I also seem to recall that you can check 'which state' the onGUI is being run in, so that you can do all of the ...
2
votes
1answer
530 views
Communication in a simple GUI (C++ / SDL2)
I've spent a few months now working on a fairly simply 2D game engine with SDL and C++. I'm now trying to develop a simple but well-featured GUI suitable for most games.
Right now I'm really ...
0
votes
1answer
97 views
Unity Make sprite visible only to shaders
I have made a shader for my UI buttons, the sprites should be black and white, so they can be used as a mask when blending. They should allow for the image behind them to pass through the whiter ...
1
vote
1answer
479 views
Unity5 UI - How to trigger button click event while preventing menu item deselect event?
So I've got a load menu using Unity's new UI system, basically just a list of save games you can select with a mouse click along with a couple of buttons at the bottom to delete or load the selected ...
1
vote
2answers
170 views
Unity: Can't press space to unpause. Is this a Unity UI bug? Or maybe poorly written code?
So I think I have a bug with my pause menu. For the sake of simplicity I've boiled down what I'm trying to acheive: When the player first starts up the game there's a UI menu with one button: 'Start ...
0
votes
0answers
71 views
Unity Buttons and selecting Objects
I'm making a tower Defence Game. and my buttons are working fine... Until i select and unselect a tower. what I've worked out, is that after I've selected a tower the follow section of code sets my ...
0
votes
2answers
154 views
Efficient UI for RTS units
I was wondering how I should approach the runtime changes on the game UI when selecting different types of units in a RTS.
For example, in Starcraft, each unit type has its own portrait, attributes, ...
3
votes
1answer
129 views
In Unity, how do I handle very short mouse drags as click events?
I am trying to recreate a UI menu that has functionality similar to the iPhone's home screen:
If a user drags anywhere on the menu (including on a button), it should drag the whole page left/right ...
1
vote
1answer
365 views
I can't drag'n'drop UI-Elements from the Scene-hierarchy into a public field (Unity 5)
I just watched this Video https://unity3d.com/learn/tutorials/projects/survival-shooter/player-health and tried to drag'n'drop the UI-Elements on the matching script, just like they did. But this is ...
0
votes
0answers
50 views
Particle system ONGui()
I have some scripts which uses OnGUI() method and they are attached to my GameMenu object. I need to play a particle system on the scene while the GUI scripts are active. When I do that I cant see the ...
5
votes
2answers
1k views
Unity UI square that fills width OR height
I'm trying to create a board with this requirements:
It SHALL be square.
It SHALL fit available width OR height.
It SHALL be centered in the canvas.
It MAY be wrapped into as many additional ...
1
vote
2answers
7k views
How to add a UI Text for keeping Score in Unity 5
My Problem is simple I want to show scores on my game. The examples on internet are good but in Unity 5 there are no GUI elements but instead these are now UI elements. I was following this example: ...
0
votes
0answers
83 views
player sprite hidden after using a stage (scene2d library)
What i'am doing is showing a tiledmap on the full screen , and it works fine.
The character moves perfectly and the camera too.
What i want is :
Showing some text or imageButton over the map like ...
0
votes
0answers
104 views
Scaling buttons in LibGDX
I'm trying to make a usable GUI for a Android game using LibGDX. But I'm having big trouble getting the fonts and buttons to a usable size. Scaling fonts work, but the results are not very pretty. ...