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

Force Immediate Layout Update

$
0
0
For awhile, a pretty frequent "gotcha" for me when working with Unity's new UI system is that items added to a layout group (such as HorizontalLayoutGroup, VerticalLayoutGroup, etc) are not immediately positioned within the layout group.

This would frequently result in position and animation calculations being incorrect until I remembered "ahh yep, got to do this in a coroutine, yield a frame, and then do these calculations." This wouldn't be so bad, but it also results in an ugly single...

Force Immediate Layout Update

RectTransform.position returns wrong value

$
0
0
Exactly as the title says. I assume RectTransform.position should give me the position of the RectTransform in world space regardless of the hierarcy, but it doesn't. It just returns some value near it.
  • Camera is orthographic.
  • I don't have weird scaling on the Canvas, it's only set to screen space camera.
  • The RectTransform is child of another RectTransform (which is why i need the position and not the anchored position, as i need to cast it back to the screen to...

RectTransform.position returns wrong value

TMPro Input Field and new Input system

$
0
0
Hi,

it seems to me that the TMPro isn't yet fully compatible to the new input system. I'm using V2.0.1 and I'm getting these error messages:

"InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings."

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player...

TMPro Input Field and new Input system

Unity 2019.3.4f1: Shader error in 'TextMeshPro/Mobile/Distance Field': failed to open source file: '

$
0
0
Hi everyone,
After upgrading from 2019.1 to 2019.3.4f1 I get this error when creating an Android build:
Shader error in 'TextMeshPro/Mobile/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 90 (on gles)
I've checked that I have the latest TMPro version, I've deleted the package and reinstalled, I've re-imported, I've done the GUI mapping, I've made sure my build setting is NET 4
Nothing works! :-/

Invisible Text

$
0
0
Any idea what could cause this? Sometimes TMP text elements are randomly invisible, but resizing the game view or window will "fix" it. Example:


Very annoying bug, I have no idea what's causing it if anything on our end. Is it known? Looks like we're on the package manager version of TextMeshPro, version preview.3 - 2.1.0. Using Unity 2019.3.2f1

Edit: Just to be sure, I updated to preview 7 of TMP, and it seems its actually somehow worse:...

Invisible Text

An item with the same key has already been added.

$
0
0
Hi,

Everything was working as expected. Today I added a new font as fallback and started getting this error:

Code (CSharp):
  1. Non-fatal Exception: java.lang.Exception: ArgumentException : An item with the same key has already been added. Key: 0
  2.        at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert(System.Collections.Generic.Dictionary`2[TKey,TValue])
  3.        at TMPro.TMP_FontAsset.InitializeDictionaryLookupTables(TMPro.TMP_FontAsset)
  4.        at...
An item with the same key has already been added.

Unity 2019.3.x - UGUI Layout Groups performance regression

$
0
0
Since we upgraded our project to Unity 2019.3 we are seeing a performance regression for the Layout Groups in our scene. We use UI with Layout groups to show data that is updated every frame and it seems like the Layout Groups are trying to calculate its size every frame even though the screen resolution doesn't change. We don't see this issue in Unity 2019.2. Any recommendations on how to optimize this?

Practical effect of "Cull Transparent Mesh"

$
0
0
The Canvas Renderer has a checkbox labeled "cull transparent mesh". The documentation says this allows geometry emitted by the renderer to be ignored when alpha is near zero.

What are the practical effects of this? Does it affect raycasting or user interactions? (e.g. does it make a button unclickable?) When should you use this or not use this?

Adjustable Character Spacing - free script

$
0
0
I was dismayed to find that the new 4.6 uGUI Text component supports line spacing, but not letter spacing. Especially since the later versions of NGUI had this option. I figured that when the UI source came out, I could probably add it pretty easily. Nope - the text layout engine isn't part of the open source stuff, and you can't get at the code or a suitable API for it.

My best workaround was to simply modify existing fonts and add extra space to every character. This is as difficult to...

Adjustable Character Spacing - free script

Version 1.5.0, 2.1.0 & 3.0.0 Preview 7 - Now Available! for Testing!

TextMeshPro.SetText() method doesn't set text properly

$
0
0
This post is just informative, and I hope it will help someone to avoid 1 day of time wasting. I even couldn't imaging that text engine could have buggy behaviour in the main method.
So, what's the case exactly?
If you use TextMeshPro.SetText() method applying any value to the text component, it will change the view (visuals will be updated) but checking that text by TextMeshPro.text property you ALWAYS will get empty string (or string, which been applied before in inspector or using same...

TextMeshPro.SetText() method doesn't set text properly

Load font from mobile device and assign as fallback TMP_FontAsset

$
0
0
I'm working on a mobile app with multi-language support, including Japanese. I do not want to include the Japanese font in the app, but I also want to use TextMesh Pro.
The font should be loaded from the device and assigned as a fallback TMP_FontAsset to my standard TMP_FontAsset.
I know unitys ui text-component is using this kind of system to make all characters of all languages available.

I´m using Unity 2018.3.11f1 and TextMesh Pro 1.4.0 with Dynamic SDF.

This is my code, but it is not...

Load font from mobile device and assign as fallback TMP_FontAsset

Canvas render mode

$
0
0
Using 2019.3.1f1 When I add a Canvas I am not getting world space, camera space, etc. for Render Mode. It's like a light - render mode has Auto, Important, Not Important. Tried restarting, deleting, remaking... It seems stuck in camera space, which is what I need right now, but I'd still like to fix.

Bug: KeyNotFoundException when using ellipsis, truncate with fallback font

$
0
0
Getting the following error:
Bug: KeyNotFoundException when using ellipsis, truncate with fallback font

Unity UI TextMeshPro not working in -vrmode None at builds.

$
0
0
I'm creating application that connects users using VR headsets and one admin that use -vrmode None. While using admin version of my app, TextMeshPro texts are not display when obstructed by any textures (see picture below) even on Overlay render mode canvas. Its worth noting that bug does not occur in the Scene and Game tabs in the Unity Editor, only in standalone builds. In addition I'm providing screen of my canvas and example of textmeshpro - text component. I'm using 2.0.1 version of...

Unity UI TextMeshPro not working in -vrmode None at builds.

big problem with lacking materialpropertyblock for ui image

$
0
0
Hi all. I need to use materialpropertyblock for UI images. How can I handle it?
I have a lot of UI square images that have different properties (Color property for example or another one). Thanks

Does Canvas in UI element get dirty when the UI element is moved?

$
0
0
Hello, I wanted to know if I put a Canvas inside a UI element(lets say an empty game object), will moving that UI element dirty the Canvas inside it.

-MainCanvas
--EmptyObject(Empty Game Object)
---NestedCanvas
----SomeUIElements
----SomeUIElements2
. . .

So if my hierarchy is like this, will moving the "EmptyObject" dirty the elements inside the "NestedCanvas"? I just want to solidify my understanding of elements getting dirty in Unity. I have read about UI optimizations...

Does Canvas in UI element get dirty when the UI element is moved?

UI Button - Click area Offset

$
0
0
Hey Guys,
I have got a problem with the Unity UI Buttons.
The "Click area" is offset and the scale of it is way off.

Hopefully you guys can help me!

Not able to move caret position to end of the line(including tags) in text mesh pro.

$
0
0
Hi,
Im trying to build a text editor for my game using unity but im facing an issue.
i have attached a video link of my project below
https://drive.google.com/open?id=1V-W69b9zwms8Sv_NEseYMTaLmiv03Kcw
as you can see here even after closing the tag im moving my caret position to end of the line through code but still if enter some characters it is getting bold as these characters are getting inserted before that close bold tag, how can i move caret to the end of the line i.e...

Not able to move caret position to end of the line(including tags) in text mesh pro.

The character used for Underline and Strikethrough is not available in font asset

$
0
0
Hello,

I recently updated Unity and now get these warnings printed quite frequently.

I don't understand why the new version of TMP requires a font to have these 2 characters. I have many fonts in my project and very few of them ever use these characters. Therefore they are not included in the font. My thought process is that I would rather either save texture space or use that texture space for higher res versions of characters that actually get used.

I can see that...

The character used for Underline and Strikethrough is not available in font asset
Viewing all 23263 articles
Browse latest View live


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