Quantcast
Channel: UGUI & TextMesh Pro
Viewing all 23263 articles
Browse latest View live

[5.2] MaskableGraphic performance OnEnable(), OnDisable()

$
0
0
Hey folks. Our UI has seen some major spikes since upgrading to 5.2 from two functions - MaskableGraphic.OnEnable() and MaskableGraphic.OnDisable(), both coming in at a whopping 51ms. There is also a 2.1 MB allocation in OnEnable(). This is occuring through GameObject.SetActive(). This did not occur in 5.1.

Is the intended design paradigm here to just make UI elements invisible, rather than disabling the GameObject? Are we in the wrong here, or is this an actual issue?

MaterialPropertyBlock on Image

$
0
0
SpriteRender has a nice way to set unique Material properties using the "SpriteRenderer.SetPropertyBlock".
Unfortunately, this is not possible with the Image component.

Does anyone know of a way to achieve this with the Image.
So essentially have one Material, applied to multiple Images with different values dictated by a Component.

Compressed sprite for mask shows fragments

$
0
0
Hello everyone!

I tried to use a compressed texture as sprite for a masked UI element.
Unfortunately, the mask will show fragments when the image is compressed.
Is using compressed sprites as masks not supported?
If possible, I would like to use compressed sprites to reduce memory usage.

Here is an image for reference:
[​IMG]
Both UI elements use the same sprite. The UI element on the left is using just an image...

Compressed sprite for mask shows fragments

[Solved] Dynamic Blurred Background on UI

$
0
0
HI,

Ive been searching the web on how to blur the background of a UI element dynamically (not a static image) using uGUI in personal edition like this but have not found anything easy to follow
[​IMG]

Does anyone know any ways how I could accomplish this?

Thanks

I cant get RectTransform.sizeDelta to change in script.

$
0
0
Hi,

I have no idea how I have created a working, published game when I cant even figure out something seemingly so simple. I have read about 20 posts on this subject, watched numerous videos, and still can not figure this out:( <rant over>

I am trying to change the width and height of an image within code.

Here is my setup in the hierarchy and my code.

Canvas
|___Image


public class lay : MonoBehaviour
{
public RectTransform rT;

void Start()
{
rT =...

I cant get RectTransform.sizeDelta to change in script.

Justify Text?

$
0
0
I have never needed this function until now, but I have just realised there is no Justify in the Unity UI for Text.
I may be wrong about this and have just not found it but I was hoping someone would be able to shed some light onto this, whether there is in fact a Justify Text setting or not, or if there is any workaround to trigger it.

For those who do not know what Text Justification is, please read here:
http://en.wikipedia.org/wiki/Typographic_alignment#Justified...

Justify Text?

Tab between input fields

$
0
0
I have a simple login form with email and password input fields next to each other.
Now I set up 2 input axes called UI Horizontal and UI Vertical and set them as navigation axes in the Event System. The UI Vertical includes Down Arrow as well as Tab key.

While the UI navigation seems to work with buttons it doesn't seem to work with input fields.
When I press Up, Down or Tab on a single-line input field it doesn't switch the focus.

How could I achieve the expected behavior?
Is this a bug...

Tab between input fields

Graphic is offset from actual rect transform

$
0
0
I just found this bug:
https://vid.me/RxyeR

It seems like the graphic of the ui object is not keeping up with the rect transform when I update its position with it being invisible, it is being rendered in the same old position, despite the fact that the rect tansform is being moved around the canvas. It only updates if I manually deactivate and reactivate the canvas component in the editor or update move the rect transform while it is visible.

What I'm doing is, if I hover over...

Graphic is offset from actual rect transform

UGUI Using 98% of CPU?!

$
0
0
I have a fairly simple scene. It is a plane as the floor (for testing) and an Adventure Creator character and MadGoat-SSAA for anti-aliasing. When I run the game, however, I get horrible performance. At only 2x FSSAA I get 3FPS and using the profiler, I find that somehow UGUI is using 98% of the CPU. The problem appears to be "Unaccounted time between: Start of frame and UGUI.Rendering.EmitWorldScreenspaceCameraGeometry (Picture for reference:...

UGUI Using 98% of CPU?!

How? Text "best fit" across multiple Text components...

$
0
0
Hi,

I have a bunch of buttons arranged in horizontal/vertical layout panels. Those buttons form a uniform grid, they all have the same dimensions. But they carry unknown text, each one a different sample. It can be assumed that whatever text they get assigned, it will look well with "best fit" in terms of a single button. Now the problem:

Each button will use a different "best fit" which makes them all use different font sizes. Is there a way to tell "best fit" to take the minimum font...

How? Text "best fit" across multiple Text components...

TMpro Input Field - "On End Edit" event and TAB

$
0
0
Hi all,

Is there a way to add the TAB keypress to the list(?) of keys that trigger the "On End Edit" event on a TextMesh Pro Input Field?
I want to emulate the behavior of a html form where pressing TAB focuses on the next input field.

I'd be delighted if TMPro fully supported InputField navigation via TAB and SHIFT+TAB though :)

Thanks.

UI objects overlapping

$
0
0
I have a pool of UI objects that I am using to show name of items that are on the ground. So every time a item drops, I take one of the UI objects from the pool and place it on the item using WorldToScreenPoint. The problem I am having is that when there are a bunch of items clustered on the ground, the UI for each item overlaps. I want them to stack on top of each other if overlapping. Not sure how I can fix this issue. Here is an image of the problem.

Content size fitter inside vertical layout group

$
0
0
I have a scroll rect that contains a vertical layout group which contains multiple text elements. This works fine when each text element has a predefined height, but what I'd like to do is put a content size fitter on them so that they will expand their height to fit the text inside them. Unity doesn't seem to like this though, as it puts a warning on the content size fitter, and the scene can be infinity saved with it still complaining it hasn't been saved. The UI elements also seem to jump...

Content size fitter inside vertical layout group

The new spriteatlas always change make the version control conflict very easyly.

$
0
0
The spriteatlas in 2017 is good for the artist pipeline. But it met some problem in daily usage.
When I create a spriteatlas, and specify the folders it need to pack. But the spriteatlas not just store the folder, but also the GUID of each sprite in the folder.
So when I commit this spriteatlas onto the version control system, and the other two people add different image to this folder, the spriteatlas will different in the two person's computer. When they commit they work without touch any...

The new spriteatlas always change make the version control conflict very easyly.

Solved: IMGUI buttons not click trough

$
0
0
Greetings!
I´m quite new to unity, so please bear with me:

I purchased an assed, that uses IMGUi buttons.
Unfortunately I need them to block click trough to the background elements.

I know about using IsPointerOverGameObject(); on regular buttons.

Like in this code:

Code (CSharp):
  1. if(GUI.Button(new Rect(20,70,80,20), "Level 2")) {            
How to prevent click not going trough the button to the background objects?

How do I overlap images in a Vertical Layout Group?

$
0
0
Greetings!

Essentially, I have a panel with a vertical layout group in which you can drop cards. What I want to do is overlap cards. So let's say I drag the first card onto that panel. Now I'm going to drag a second one. This second one will stay on top of the first card, though not completely, as I want the top of the first card to be visible. I've looked around to see if I could figure it out but no luck. How can this be done?

Here's a quick illustration:...

How do I overlap images in a Vertical Layout Group?

UGUI Unity5.6 CanvasRenderer vertex define has no uv1 ???

$
0
0
I used UI vertex extra parameters , just uv1 , so I used both uv0 and uv1 . Using the api
" VertexHelper.AddVert(Vector3 position, Color32 color, Vector2 uv0, Vector2 uv1, Vector3 normal, Vector4 tangent);" . and my shader use VSInput texcoord1 like this


struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
float2 texcoord1: TEXCOORD1;
};...

UGUI Unity5.6 CanvasRenderer vertex define has no uv1 ???

[BUG] I can't change settings of shader

$
0
0
I could change settings of every text before, but now I can't click, as you can see Underlay is enabled, but I can't modify it or unable it again. This happens with all the text and I have reinstalled TextMesh Pro without solving anything.

I would appreciate some help, thanks.

View attachment 237229

ScrollView / ScrollRect Scrollbars controlled by directional input - how to disable?

$
0
0
Every so often, we get bug reports from players who are using some kind of directional movement (usually arrow keys, but sometimes numpad, which are mapped using Rewired in our game) and unintentionally scrolling around in a ScollRect/ScrollView UI object that is also on the screen.

I've done absolutely no scripting to connect any kind of directional or keyboard input into scrolling whatsoever, so this seems like behavior that might be native to scrollbars...? However it's really...

ScrollView / ScrollRect Scrollbars controlled by directional input - how to disable?

Target overlay best practices?

$
0
0
Yeah so I'm trying to create a basic target overlay for my spaceships. I don't even know where to begin, and perhaps my google fu is not very strong this morning but I haven't found anything relevant on google or the unity website search feature.

How would one go about this? I think it would be most helpful if the overlay were in front of the ships geometry rendering instead of some kind of UI screen space method. I believe I had something rudimentary like that working in past unity...

Target overlay best practices?
Viewing all 23263 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>