Graphical User Interface. A term used to describe the tools available to the player to interact with the game.

learn more… | top users | synonyms (1)

1
vote
3answers
268 views

how to handle interactive choice in the middle of the game loop?

I am programming a turn-based game, 2D tile-based, overhead view. I have an update function and a render function running in separate threads. When it's the player's turn, the player can e.g. ...
0
votes
3answers
107 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 ...
2
votes
2answers
78 views

WorldToGUIPoint seems always off by about 2 pixels

I'm trying to draw small boxes at each vertex of a mesh, in the editor. My OnSceneGUI code looks like this: foreach (Vector3 vertex in _mesh.vertices) { Vector3 worldVertex = ...
1
vote
2answers
863 views

Camera.WorldToScreenPoint not working with perspective

transform.position = Camera.main.WorldToScreenPoint( new Vector3( origin.position.x, origin.position.y, origin.position.z ) ); I have this code on a Unity 4.6 UI object. The origin is some transform ...
1
vote
2answers
1k views

How do I create a message box that fires a callback on button press?

I need to create a message box with an "OK"-button. When the user touches the button, it should execute a callback. I'm new to this and couldn't find any articles in the docs.
0
votes
2answers
34 views

Detecting Left and Right Mouse clicks on UI Text objects that are dynamically created

So, in my game I create a bunch of UI Text game objects dynamically (in the C# script), but I just can not find out how to properly detect Left and Right mouse clicks on these UI Text that were ...
4
votes
1answer
109 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 ...
4
votes
1answer
239 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 ...
2
votes
1answer
427 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 ...
2
votes
1answer
155 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 ...
2
votes
1answer
630 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 ...
1
vote
1answer
37 views

Rendering a dynamically sized box

So in games where there are textboxes with different sizes appearing, how does one actually render them efficiently? Games like Final Fantasy IX have dynamically sized speechbubbles for example, each ...
1
vote
1answer
108 views

Unity UI Button not working on PC build but working on Android mobile build

I am using Unity to build a game that is going to be used on PC and on mobile devices also. The problem I have is that when I use Unity UI Button, on mobile (android) is working perfectly but on PC ...
1
vote
1answer
180 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 ...
1
vote
1answer
429 views

NGUI Texture Background Font of Sprite

I am new to Game Development and using NGUI plugin free version. There are few sprite images in my game. I made them prefab and instantiated at runtime. then I created NGUI Texture and Made it ...
1
vote
1answer
1k views

Simple heart container script for 2D game (Unity)?

I'm attempting to create a simple mobile game (C#) that involves a simple three-heart life system. After searching for hours online, many of the solutions use OnGUI (which is apparently horrible for ...
0
votes
1answer
27 views

UI Text Won't Change Color in Unity 5

In Unity 5 on Windows 10, I try to change the text color from the Inspector and in scripts, but the color won't change. Here are some screenshots of my Text objects open in the inspector, with there ...
0
votes
1answer
41 views

Prevent button layout changing after one is removed?

I have a layout with four buttons in it. I end up removing one of the buttons using: View v = (View) findViewById(R.id.ViewId); ((ViewManager) v.getParent()).removeView(v); The ...
0
votes
1answer
313 views

Unity 5 C# - onClick.AddListener in a foreach loop using lambda expressions

I'm trying to dynamically create Unity 5 UI buttons that each set a global variable decision_id to a different value when clicked. The problem I'm having with this implementation is that they all ...
0
votes
1answer
158 views

Draw GUI.Button on certain position on a scrollable background

Problem is in a 2D game I have a large background around 2 screens wide. And on there I got 4 buttons placed on top of background all over complete width. Now when I swipe of move my mouse around I ...
0
votes
1answer
470 views

Make GuiText responsive

I'm using C# code to make a responsive GuiText. I was abel to make a responsive GuiTexture, but I'm struggling with doing the same for a GuiText. Code for the responsive GuiTexture using ...
0
votes
1answer
389 views

Should I render all of my HUD views to a single SurfaceView?

I'm using a SurfaceView and canvas to implement a game HUD, title screens etc., by overlaying standard Android view widgets over my SurfaceView. This works reasonably well and maintains an acceptable ...
2
votes
0answers
46 views

Why are parts of this Unity scrollrect not being bound to the mask?

I'm setting up a system for people to load up extra levels. Since I don't know how many levels are going to be loaded I have a UI prefab that gets added to the main Level Load UI. However, the Text ...
2
votes
0answers
162 views

1:1 mapping of texels to pixels with DX11 and multisampling and linear interpolation

Is it possible to get a 1:1 mapping of texels to pixels on a multisampled target in DX 11 with interpolation? It seems to me that the texture coordinate used in the shader is always one of the ...
1
vote
0answers
13 views

Unity: onEditEnd and onSubmit only firing from Return key

I have an InputField in my UI, but currently I can only submit its contents via the Return key. I tried mapping other buttons to the Submit action (e.g. the tab key on keyboard and the X button on my ...
1
vote
0answers
19 views

Unity keyboard GUI navigation priority

I noticed something strange while playing with my menu on keyboard. I have four items arranged in a square (i.e. the top-left item should be able to navigate to the top-right and the bottom-left). If ...
1
vote
0answers
57 views

Why are these unity UI buttons only responding to the top half?

I'm instantiating UI objects with buttons on them into a scrollrect. For some reason, all of the buttons will ignore their bottom half with the exception of the last prefab instantiated. Below is a ...
1
vote
0answers
26 views

Help with open and close UI Menu on background mouse click

I am trying to make a point and click game in unity 5.2.2. My problem is that I need to have a UI menu to open, when the player clicks with the left mouse button on the background sprite, and it ...
1
vote
0answers
30 views

Change gui in java game

im making a 2D Server/Client game, i have very little to no problems with the server but now i wanna work at the client. I think about using a JFrame and all the other gui classes/methods. My question ...
1
vote
0answers
65 views

Unity Javascript GUI.Button shows up twice

Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts. However for some reason it prints each button twice to the screen, once with my custom style, and once ...
1
vote
0answers
311 views

Keeping crosshairs & GUI onscreen - SFML

I read this question, but didn't understand the implementation suggestions with SFML on C#. For example, right now I'm just trying to make sure that the mouse crosshairs stay onscreen constantly. I ...
0
votes
0answers
41 views

Apply Pixel Perfect by script in Unity?

How can I apply Pixel Perfect by script in Unity? All I could find on the web is this which does help at all..
0
votes
0answers
32 views

How to create a toggle button with slate in unreal engine?

How can I create a toggle button with slate? By toggle button I mean a normal button which remains pressed after one click and returns normal after a second click (the style is toggled). It seems ...
0
votes
0answers
48 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 ...
0
votes
0answers
109 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 ...
0
votes
0answers
21 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 ...
0
votes
0answers
46 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 ...
0
votes
0answers
136 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
148 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 ...
0
votes
0answers
92 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
0answers
57 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 ...
0
votes
0answers
130 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
185 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. ...
0
votes
0answers
25 views

How to handle game widget destruction as a result of an event?

I have a simple hierarchy of containers and widgets like buttons, line edits and labels. Every node in this hierarchy is a Widget, specialized with a subclass to make custom behaviors for each type of ...
0
votes
0answers
278 views

hide and show many guiTexture

in the 1 scene there are many guiTexture. So how to write this code ? public class guiTanya : MonoBehaviour { public GUITexture guiA, guiB, guiC, guiD, guiE, guiF; void onMouseDown() { //if i press ...