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

learn more… | top users | synonyms

0
votes
1answer
11 views

How to get Unity's 4.6 UI images to layer over each other perfectly?

I've been noticing that if I have two images, lets say squares. I have A as the parent of triangle B. Triangle A and B both have their offsets at their anchors, which are on the 4 corners of it's ...
4
votes
1answer
60 views

Blocking Physics Raycasts with Unity's 4.6 UI?

I use raycasts to determine hit objects and object selection in our game. I want these to be blocked by UI elements. Before I had a crude form of that where I just excluded rects of the screen, though ...
1
vote
0answers
52 views

LibGDX scene2d good practices

I'm developing a game using LibGDX and in a part it has a pretty complex UI for profile selection and stuff. I have some general problems. I'd like to know good practices when generate good looking ...
1
vote
0answers
16 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 ...
0
votes
1answer
73 views

Unity 4.6 UI button AddListener sets the same callback to all items in List

I have this method that is looping through a list and sets values on the current item in the list. Everything works fine the lists values are correct exept the AddListener. All listeners on the ...
1
vote
2answers
78 views

Curved Meters and Gauges

I'm wondering how people here on GameDev stack exchange would handle curved meter GUI elements for things such as life bars or energy bars. My thought on the matter was that you could use a shader ...
1
vote
2answers
63 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 ...
0
votes
0answers
12 views

How to setup States in NIftyGUI and LWJGL

I think this is a simple question but I just cannot figure it out. I have a main menu that is using nifty gui and then my game which is rendered using OpenGL Code (LWJGL) I cannot figure out how to ...
0
votes
2answers
53 views

How do I access my existing script from a different script attached to a different gameobject?

I have my health(script) component on my player gameobject that gets boosted whenever we tap on that gameobject. However, I want to add a separate Gui texture button gameobject and tap on that to ...
3
votes
0answers
53 views

Unity Canvas blocking objects in Editor

I think I am missing something really basic here..., I'm creating a 2D game in unity, and the UI Canvas (with the setting "Screen Space - Overlay") is blocking exactly a quarter of my workspace. I can ...
0
votes
1answer
122 views

Unity, Why a Text object can't be edited?

I have an input field and event that calls a function when I press enter. public Text theText; I take the Text part of the input field (connect them in editor), display the content and set new ...
0
votes
1answer
42 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
0answers
20 views

why the camera didn't capture gui position properly?

I make an GUI.DrawTexture and it's draggable, i want to make my GUI detect 3d object when i drag it to its position. The method works properly with guiTexture, but when i used it for GUI.drawable the ...
1
vote
1answer
223 views

Changing color of UI Text in Unity into custom values

There are a few objects in the scene as well as a title. I want the title to change its text and color based on the object that is mouse-overed. The script below is added to each object that is ...
1
vote
1answer
460 views

Button stays highlighted after being clicked - Unity3D 4.6 GUI

Sometimes, after clicking a button created by unity's new UI Button, the button stays in its highlight state. Note that Button script has Color Tint set as it's Transition property and the ...
0
votes
2answers
213 views

How do I create a simple clickable button?

I've tried to attach this function to the play button. public void Play () { Application.LoadLevel("Scene1"); } I've created an empty Game Object and attached my script to it. But when I go to ...
0
votes
1answer
88 views

Libgdx drawing semi-transparent circle on pixmap

I am currently working on an android game using libgdx and would like to add a joystick to its interface. For this I use the built-in touchpad class. Untill now I have used external images for ...
1
vote
1answer
82 views

How to make sure that all the UI elements were the same size on all screens in new Unity 4.6 UI system

I have made a HUD for my 2d mobile game with the help of the new UI system, that was introduced in Unity 4.6. But when I am trying to play game in Unity editor, the UI elements have normal size, but ...
4
votes
2answers
400 views

Is there an alternative to VBOs or deprecated functions to draw many small quads?

I was thinking about how to program a user interface in a 3D game. The problem is, immediate mode (glBegin and glEnd) is deprecated for a long time but I don't think vertex buffer objects (or arrays) ...
0
votes
2answers
205 views

Can the GUI be used to create game objects?

I want to be able to position 10 various game objects (sprites) within the area of the screen which will be dynamically sized accordingly to the screen size of the device. The area in which I want to ...
2
votes
1answer
89 views

How can I position a sprite in the same spot across different screen sizes?

Taking into account the multitude of screen sizes and resolutions, is there a way I can position a sprite so it's at roughly the same spot on every iOS device? Doesn't matter if you are using ...
1
vote
1answer
507 views

Unity 4.6: Position jumps when switching Canvas render mode from Overlay to camera in code

In the project I am currently working on I have two sets of main UI: one set that is on the screen at all times for the players use, and the second set which the player can open and look at to gauge ...
0
votes
2answers
77 views

GUI Text counter Skips numbers after a few seconds

The counter counts perfectly up until the first bump. After this it starts to add about 4-5 "points" instead of just 1. using UnityEngine; using System.Collections; public class GameController : ...
0
votes
0answers
26 views

Using fonts in Scene2D GUI

I'm learning how to use Box2D and Scene2D together. I'm trying to create a Sprite class that combines a Box2D body with a Scene2D actor. Before I can do this I need to set up the environment I plan to ...
0
votes
1answer
187 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 ...
0
votes
2answers
108 views

Scaling a GameObject for a progress bar representation

I am trying to implement a progress bar system for my game. I know that it could be done with Unity's OnGUI and scaling with width of the texture but I don't want it to be a GUI element because in my ...
4
votes
1answer
1k views

Consume input events in Unity 4.6

How do I consume the input events in the new 4.6 unity gui system? If I click on a button for instance I don't want anything else non GUI related that might be listening for mouse input to react to ...
3
votes
2answers
667 views

How to make a scrollbar?

I am making my own UI for my game, no libraries used, basic UI with simple controls and I am almost done. Now, let's say I need to display lots of information, controls or items which obviously won't ...
0
votes
1answer
71 views

Spawning a Sphere and trying to move it [closed]

I've been trying to build upon a blog post on Gamasutra http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php In this I would like to spawn a ...
0
votes
2answers
121 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
2answers
60 views

How do I attach UI data to logic data?

I'm attempting to write an inventory system(C++, doesn't need to be huge), that later on should be able to be drawn in a GUI. In the file structure, I think it would be best to put both information ...
3
votes
2answers
1k views

Detecting mouse clicks in Unity UI Beta

I want my game script to detect mouse clicks everywhere on my screen, except one corner where I have a pair of buttons to control the sound and will be handled separately. To help identify this ...
3
votes
2answers
878 views

How to design a drag and drop inventory system with transition from icons to game objects?

I’m trying to write a simple 2D game in Unity with an inventory where the user can drag and drop different objects on the screen. I need the inventory to contain icons which on drag will become ...
9
votes
2answers
16k views

Unity 4.6 GUI - Dynamically change the functions called by GUI elements

Looking to dynamically change the value in the button OnClick and slider On Value Changed . If I had to guess on how this was done, get a reference to the button/gui element. Next get the Button ...
0
votes
1answer
603 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
2answers
1k views

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

I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize ...
0
votes
2answers
330 views

How to show a float with no decimals [closed]

I want to show the current health and stamina of the player using GUI.Label. All is working fine however it shows the values with decimals to the millionth (example: ...
2
votes
3answers
392 views

How to display a GUI Texture for a certain amount of time

Is it possible to make a gui Texture display for a certain amount of Time.
1
vote
1answer
473 views

Generating a particle effect on top of a GUIElement (Unity)

I am working in Unity on a 2D project which is using C#. I have a number of guitextures which are hearts in order to create a sort of life meter. I would like when the player loses a heart for the ...
0
votes
1answer
86 views

SDL Surface clipping mask

I am creating a GUI for my game, so I use some buttons like . So you can see it is only text surrounded by a rectangle. But I currently use a huge png image with all the buttons I need arranged as I ...
0
votes
0answers
182 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 ...
0
votes
1answer
389 views

Unity Gui from text file templates

I've been banging my head against a wall this past while over how I might create menu's and menu components in unity from text file. I would normally just build my own extended panel/label classes etc ...
0
votes
1answer
328 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 ...
2
votes
1answer
1k views

How to match font size with screen resolution?

So I'm working on a game using LibGDX, and I have a problem. To make my game fit most resolutions, I created a base asset for each aspect ratio, for example, a main menu background image, I made it ...
0
votes
1answer
845 views

SDL2 window as child of Win32 GUI

I'm building an editor. Is it possible to create a child window of SDL2 within a Win32 gui? (The most obvious page from SDLTutorials works for earlier versions of SDL)
0
votes
1answer
1k views

Going from WPF to Unity3D, how to implement the MVVM-pattern?

I've been working with MVVM in WPF for a long time and I'm now trying out Unity3D for a GUI-driven application. Can I work with view models and bind them to properties in GUI-components? I guess the ...
0
votes
1answer
515 views

Libgdx actor bounds are wrong

The Actor's boundaries are not centered at the ButtonText but I used the setBounds() method. The higher the Y position is, the less centered is the boundary. The weird thing is that i only created ...
1
vote
2answers
351 views

Hide part of the GUITexture in Unity

I have a Health Bar in my Unity game and it's implemented as a GUITexture with gradient image from red to green. Now I can reduce it's width from max width to 0, but is still scaled gradient. ...
0
votes
1answer
279 views

How do I animate Unity GUIComponents?

I want to transform my GUIWindow from the bottom of the screen to the middle whenever the user presses a button. How can I do this?
1
vote
2answers
2k views

Prevent GUI Clickthrough

I'm using NGUI to setup my UI in Unity. Attached to the MainCamera I do have a script to rotate the camera view by clicking and dragging. It does handle mouse events using Input.GetMouseButton(). ...