ugui | Cross-platform C++ SVG-based GUI library
kandi X-RAY | ugui Summary
kandi X-RAY | ugui Summary
Cross-platform C++ SVG-based GUI library, used by Write for iOS, Android, Windows, macOS, and Linux. Why consider choosing ugui?. Written for SDL2, but example_glfw.cpp, with a simple translation layer glfwSDL.c, shows that using a different framework is not difficult. In the future, platform support may be added to ugui itself.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ugui
ugui Key Features
ugui Examples and Code Snippets
Community Discussions
Trending Discussions on ugui
QUESTION
In my unity application, I need make little rectangular components with a string on them. However, I want the size of the rectangle to dynamically line up to the text inside it. This is the hierarchy in my prefab:
According to this article, I just need to add a content fitter to the canvas. I did that and set both horizontal and vertical sizes to "preferred", however apparently the width is just 0 (0 is getting printed out by my Debug.Log). This is my code. I think the issue might have to do with changing the render mode, but this is for a VR application so that needs to stay:
...ANSWER
Answered 2021-May-24 at 17:53I believe this should answer your question - if you have more issues with this implementation, just let me know.
Firstly, remove all code with resizing. Unity's component UI system is very powerful when used properly. Almost anything you would want to achieve with dynamic UI can be done using just components.
Firstly, your container holding the text should have a Horizontal Layout Group
or a Vertical Layout Group
attached to it. Turn off all toggle boxes except for Control Child Size
- Height
. Set the width of this container to whatever you want the width to be, the text will fill to this size.
Along with a layout group (you can choose either one, but as your text is vertical you can use a vertical layout group), you will need a Content Size Fitter
with the Horizontal Fit
set to Unconstrained
and the Vertical Fit
set to Preferred Size
.
It should look something like...
Now moving onto the text component, you can use a Unity.UI.Text
component or a TMPro.TMP_Text
component, either one will work. In this example, I am using the vanilla Unity.UI.Text
. Simply type whatever message you would like in the text field and your parent container should resize to the text field. If you are dynamically setting this text often, you might need to force Unity to rebuild the layout group of your parent object to rescale.
An example snippet of this could look like...
QUESTION
I am trying to create a connection to the Firebase Realtime Database by following this tutorial: https://medium.com/@rotolonico/firebase-database-in-unity-with-rest-api-42f2cf6a2bbf to understand how it works and modify as I go. However, I am getting the following errors (these are just some of the errors):
...ANSWER
Answered 2021-Mar-06 at 16:12I was able to determine the issue. It appears that although the instruction suggests adding the source folder in the assets folder of the Unity Project, I remove it from there and put it in the same level as the assets folder. That resolved the issue. Hope this helps anyone else who has encountered this issue.
QUESTION
I have a problem that I cannot input using the Stylus pen in Unity Android.
When the Stylus pen touches the screen, the first OnPressDown event is called, but then OnPressUp is not called, and all pen inputs are not operated afterwards. OnClick of Unity's UGUI Button is not being called either.
Pens that work normally in other Android apps, but the above problem occurs in Android apps built by Unity.
The pen is made in China, but the exact model is unknown.
Is there anything in doubt?
Please understand that the sentence may be awkward using a translator.
...ANSWER
Answered 2021-Jan-19 at 03:27I solved myself
The handling of pen input is included in the Input System Package supported in Unity 2019 or higher, so the problem was solved by installing the package.
QUESTION
all.I have a question after learning unity ugui.
There is three mode of the render mode of unity canvas.
Screen Space - Overlay mode keeps the UI can be drawn over any other graphics. But if I want to show any particles or effects in the front of UI.It becomes very difficult.And the UI elements can't be affected by Post Processing.
Can anyone tell me this mode there is any other special advantage?
...ANSWER
Answered 2017-Dec-24 at 22:46you have to set the canvas to World Space.
here is the link to the documentation. https://docs.unity3d.com/Manual/HOWTO-UIWorldSpace.html
QUESTION
I have a Canvas with a button and a "TextMeshPro - Text" component. When I click the button I want to update the text of the textMeshPro component. This is the code I'm using:
...ANSWER
Answered 2019-Dec-14 at 22:44Canvas
is the parent of the text object
You need to either use transform.GetChild()
, transform.Find()
or GetComponentInChildren<>()
QUESTION
I have this simple structure inside a Canvas:
- GameObject (Vertical Layout Group)
- UI Image (Vertical Layout Group)
- TMP UGUI Text (Horizontal Layout Group, Content Size Fitter)
- UI Image (Vertical Layout Group)
Now, it works pretty well, when the text gets out of boundaries, the UI-Image expands. But since I have a Layout Group as a parent to my TMP Text, I get an error inside the Text, in the Content Size Fitter, saying that 'The parent has a a type of layout group component...'. And as a result, the image height sometimes doesn't update when I the text changes (doesn't grow or shrink, only after I refresh or save the project).
Am I doing something wrong here?
...ANSWER
Answered 2018-Oct-31 at 02:32I will convert this to answer since I'm going to attach images. I did something similar to this for a chat feature.
Make the parent have the content size fitter and set either the horizontal or vertical fit to preferred size.
Let its immediate child be the background, and add a layout element to it to control its minimum size. Also add a layout group to it to control the text that you will put as a child to it.
[EDIT]
1. I changed the Parent's layout group to VerticalLayoutGroup
.
2. I made a duplicate of the game object "Background" but with different texts to that you can see how the ContentSizeFitter
and VerticalLayoutGroup
controls the size of the children.
In the screenshots above, I never adjusted anything on the rect transform. I just changed the text, and as you can see, the background of each text/dialog/message also adjusted.
QUESTION
Whenever I load an existing Unity project in Rider, Unity doesn't make me run/build it, returning blank errors in the console.
I have tried reinstalling Unity and deleting Rider's configuration files.
I also believe the bug may be caused by the "Rider Editor" Unity package not working correctly.
Also, after reloading the Unity project, all of the Unity Scripts associated with the Gameobjects are unable to be loaded.
I found this in the Editor.log:
...ANSWER
Answered 2019-Jun-15 at 08:54I am not sure if this is a coincidence or not but it seems like the bug stopped occurring when I upgraded from 4GB of RAM to 16GB. This seems like is completely unrelated, but the bug itself started occurring when I was forced to downgrade to 4GB of RAM due to one bank failing.
QUESTION
I have a prefab built of game objects that have the Text Mesh Pro UGUI script on it. The script is referencing a font asset (Nogame-pro-regular.asset):
This prefab is a part of an asset bundle called "menus".
This font asset is part of a directory which belong to an asset bundle called "fonts":
During editor time, the font asset is displayed correctly along with its material presets:
But during run time, after asset bundles are downloaded, the preset selected is incorrect (the default preset?/default font asset?):
I have already tried taking the font asset out of the "fonts" directory (which belongs to an asset bundle) - didn't help.
Any help/suggestions are highly appreciated!
(Using Unity 2017.4.1f1)
...ANSWER
Answered 2018-May-03 at 20:07Issue was solved after upgrading the Text Mesh Pro to the latest version, 1.2.2.
QUESTION
I am programming a Login for users in Unity. I have 2 "Text Mesh Pro UGUI" input fields for a username and a password.
I need to convert the username (which is a number) into an UInt32 to handle the Login of the User.
But there is a Problem with this simple string → UInt32 parsing.
This is the code:
...ANSWER
Answered 2019-Mar-02 at 23:04probably there is white space character in username.text
you can remove that white spaces with this code
QUESTION
I want use jslib to get url parameter
code like this
jslib
...ANSWER
Answered 2018-Aug-31 at 09:09To return string
from Javascript to Unity, you must use _malloc
to allocate memory then writeStringToMemory
to copy the string
data from your v1[1]
variable into the newly allocated memory then return that.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ugui
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page