Questions tagged [gui]

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

109 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
2answers
2k 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.
4
votes
0answers
173 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
4
votes
1answer
314 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 ...
4
votes
0answers
347 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 sub-...
3
votes
1answer
289 views

Create context menu in Scene view

I created some MenuItemfunctions for navigating, which are currently displayed on the menu toolbar. The C# code: ...
3
votes
0answers
175 views

Quest UI Display in Unity 2D

I have this quest manager script where I store all my quests for easy duplication. I'm adding a feature that gives the player the option to see his/her current to-do quest. The first thing I ...
3
votes
0answers
491 views

Create a curved UI

I am new and Unity and I want to do a curved UI as if I project a canvas on a cylinder, a bit like this : picture Thing is, it is not that easy. I found this question and answer, but didn't manage to ...
3
votes
0answers
533 views

Find Max Line Count for Unity UI.Text

I'm trying to determine the max line count of a UI.Text with VerticalOverflow set to truncate...
3
votes
0answers
70 views

Get the position of a GUI.Button and instantiate in its position

I am trying to instantiate a GUI.Box in the position of my GUI.Button when it is clicked but I just cant seem to get the position of the button. The button does change position. Here is the code of ...
3
votes
0answers
1k views

How to make a fade effect on the Unity's scrollView?

I have a basic ScrollView, with some additional scripts so it snaps to the nearest element (focusing on it). When I perform the scroll, it looks like this: What I ...
3
votes
1answer
1k views

Resize Label automatically with the text content in LibGDX?

In LibGDX, I want to add some long text content to several Labels. I'm creating those labels in a loop, and the text content is different in each iteration. I want the ...
3
votes
0answers
92 views

External gui within a render loop

I was wandering how easy is to interface existing Java programs/GUIs inside a game loop. Sorry if my question is a bit vague. I'll try to explain. I am currently designing a simulation environment ...
3
votes
0answers
352 views

Unity 5.3.5 - Blurry UI text after switching canvasses - until text is refreshed by turning visibility off/on or changing resolution

I have multiple scenes in my project where the canvas are switched between, each canvas having UI text included on it. The project was originally created in version 5.0 and I have just updated to ...
3
votes
0answers
506 views

Optimise Gear-VR text rendering with Unity

I have a problem with my text being always kind of broken, so there are just some parts of the text visible (parts of letters) and the text flickers a lot. At the moment I have this text 2D-UI text ...
2
votes
2answers
47 views

how to structure game logic for user interfaces of different nature (gui, tui, cli)?

I would like to implement a simple game logic engine that is agnostic to the rendering system, but I don't know how to do that, really... so I would like to have advise and know the state of the art! ...
2
votes
0answers
640 views

Why doesn't the Camera.pixel(Height/Width) match the Canvas size?

I am making an app that has a custom viewport Rect like so: When I check the sizes of this viewport rectangle in pixels with Camera.pixelHeight; Camera.pixelWidth,...
2
votes
1answer
2k views

How to reset RectTransform's position?

So, I am trying to make a simple GUI Instantiate system. The GUI is going to spawn successfully, but the position is wrong. ...
2
votes
0answers
359 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 ...
2
votes
0answers
399 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
3answers
1k 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 ...
2
votes
1answer
1k 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
0answers
21 views

Drawing rectangle around a target on screen

I am just started with Unity and C#. I need in my work to do rectangle on a scene. I have a 3D scene, say some warehouse and there is an object. Camera is animated and moving towards the object. Is it ...
1
vote
0answers
26 views

UI clicks hitting the GameObjects below

I've made a simple script which makes a mesh with a collider act like a button. However the mesh button get clicked through the UI. I figured out how to fix this in editor, however this problem still ...
1
vote
0answers
31 views

Pan over an image like a map using scroll container in godot?

I want to create a level select screen, the aspect ratio for my game screen is 576*1024 and the image, I am using is 2048*2048. What I want is for the user to scroll the screen and navigate along the ...
1
vote
0answers
312 views

Unity Input System On-Screen Button doesn't work with touchscreen 2019.3.2f1

I am trying to make my player jump whenever the space button is pressed (if a keyboard is present), and I'm adding a on-screen button for players on mobile. The on-screen button works fine in the ...
1
vote
0answers
258 views

Unity calculate the size of a text box before text gets drawn so it can lerp to the next size

Im trying to make a dialog box image that lerps to the next size. In order to do that I need to calculate the size of the image before the text gets drawn. My idea is to use the legacy GUI stuff ...
1
vote
0answers
2k views

Using Unity Post Processing v2, how can I apply processing effects to just the UI?

I am using Unity 2018.3 with HDRP 4.9, and Post Processing 2.1.3. I would like to apply post processing effects (i.e bloom) to the UI only. I tried the 2 camera approach, but still can't get it ...
1
vote
0answers
21 views

How to attach an UI button to a prefab and follow it in Unity2D

My plan is creating a button above my prefab (a tree) and whenever my character is detected, the button will appear and allow me to click on it to active a dialog. I just want my trees are randomly ...
1
vote
0answers
495 views

How to sort cards' on-screen positions by their suit?

I have a 13 cards and sort button. When I click that button, I want all the cards of each suit to be grouped-together on screen. So if I have 4 diamond cards in my 13-card hand, all 4 diamonds must ...
1
vote
0answers
55 views

How can I render 3d objects over uGUI?

I have a scene with 3d objects but need uGUI as background. How can I achieve this?
1
vote
0answers
178 views

Unity: redraw only part of the GUI

I am making an RTS game which currently has a very heavy GUI and takes up sometimes 50% of the CPU time per frame. Most of the data on the GUI remains constant, (selected units and their avalible ...
1
vote
0answers
219 views

Image looks GOOD on the editor but BAD (blurry) on the HTML5 export

I have a red bar that looks good inside Unity editor, but when I export the build it looks very strange. Any idea on how to fix this? The image on the left is the one with the strange/bad looking red ...
1
vote
0answers
69 views

Unity built-in Network Lobby How to move GUI?

I'm using built-in network manager HUD and I'm fine with it for now. But I can't move lobby GUI, only Network Manager HUD. Is there a way to move it down to make space for Title Art?
1
vote
0answers
29 views

Unity: Retrieve animation names from imported blend file

I am just trying to generate a list from all animations within my Blender Asset file (see image) This is what I have so far: ...
1
vote
0answers
110 views

Create button in NGUI

I try to create a button with the help of the NGUI. Here are screenshots of me doing that: So the problem here is the next. When clicking play button in game mode I hope to get the following line in ...
1
vote
0answers
256 views

Execution order of uGUI events in Unity?

I'm trying to understand how UI events fit into the overall Unity update loop. Specifically, I want to manually call onClick via script, and then modify the effect ...
1
vote
0answers
430 views

GuiSan | SDL2 - Setting colour key of render target results in having an black screen

At the moment i am experimenting with guisan within my little project. Everything is done sofar with SDL_Texture except Guisan which utilize SDL_Surfaces instead SDL_Texture for rendering itself. Per ...
1
vote
0answers
155 views

How can I prevent a GameObject within a ScrollView from moving?

I have a ScrollView. It has children, most of which I want to scroll, but some of which I want to remain still. Think of something along the lines of a spreadsheet where the title rows/columns don't ...
1
vote
0answers
96 views

How to get what button was clicked on?

Other contexts in which this was done I'm sure have been answered for this kind of problem before. But this has thus far been a 2 week long impasse of wittling down all the other suggestions I've seen ...
1
vote
0answers
284 views

Displaying an image when ScrollPane item is highlighted

I would like to have images displayed when an item in the list is highlighted as a form of a "preview" of the map that is selected. I'm not sure how i would implement this with clickListeners or ...
1
vote
0answers
671 views

Unity Event after Layout update but before OnWillRenderObject()

Looking for subscribe-able event that occurs right after Layout update in Unity but before OnWillRenderObject is called. Working solution is Canvas.willRenderCanvases, but useful to know if more ...
1
vote
0answers
640 views

Unity Mask shows black content in world space canvas (Vuforia)

So I've built my scroll rect, like this reference tells me to do : http://docs.unity3d.com/Manual/script-ScrollRect.html -> Scroll View (Rect Transform with scroll rect attached) ---> Viewport (Image ...
1
vote
0answers
57 views

Unity UI - Assigning Event Callbacks Via Script Fails for Objects Instantied by script

So I have a pretty basic tower defense game going on, there are set build points each with their own mini canvas UI for building and upgrading towers. Once you build a tower on them, they disappear ...
1
vote
0answers
2k views

How does the Unreal Engine transaction (undo/redo) system work?

I would like the transaction system to handle the create/update/deletion of some custom objects. Then I can proceed as follow: ...
1
vote
0answers
58 views

Minecraft Crafting GUI weird bugs

I'm writing a Forge mod for Minecraft 1.8. When I'm pressing the 'z' key a 3x3 Crafting grid should open. In the KeyInputHandler I call ...
1
vote
0answers
64 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
83 views

Change GUI in Java game

I'm making a 2D Server/Client game, I have very little to no problems with the server but now I want to work on the client side code. I'm thinking about using a JFrame and all the other GUI classes/...
1
vote
0answers
87 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
365 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 ...
1
vote
1answer
567 views

2D Driving Game with Unity

I'm trying to make a 2D car driving game in Unity and I'm having problems with my code. I am able to move forward,backward,turn left/right using arrow key from my present code ...