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

Get point in an image and replicate in any other resolution

$
0
0
Hello! I am trying to get the exact point that was clicked in an image in a Canvas.
The user can upload an image, which is then displayed as an UI Image with an Aspect Ratio Fitter component inside the Canvas.
But I am having trouble replicating the same exact point in which the image was clicked when changing resolutions.

Any suggestions? Thanks in advance!

Button Animation Transition Bug

$
0
0
Hey guys

Trying to animate my buttons when pushed (scale it down).

I used the Animation Transition on the button and in the "Pressed" clip I set my button scale to 0.8.

The problem is that if I am on the edge of my button, the states constantly switch between "Pressed" and "Highlighted" as seen in this GIF:


If I remove the "Highlighted" state, then the button gets stuck in "Pressed" state.

Another issue is that in the GIF above, the button...

Button Animation Transition Bug

Button Animation Collision Area

$
0
0
Hi guys, coming from ngui I am a little confused about "collision areas." It seems as though the image itself on the button object is used as the collision area when using a ugui button, is this right? If the image is resized when you animate the button, the button collision area is resized as well, which can cause a lot of headaches. This leads to the animation getting stuck in an infinite on off loop if you hover in the outer area near the edge of the button.

For example:
1.Have a button...

Button Animation Collision Area

RTL Text Mesh Pro. Free and Open-Source plugin to add Persian and Arabic support to TextMeshPro

Unity UI Slow to Initialize

$
0
0
Working on a talent tree using Unity UI.
View attachment 581032

Each talent square has components like a border, background, text, event system, etc. I create the talent squares using a script... and currently each talent square takes 3.8ms to generate! Considering a typical game may have ~1000 talents this results in a 3.8second game freeze when the talent UI squares are generated.

It's not even so much the UI as it is Unity being bloated/sluggish. Simply generating a new empty...

Unity UI Slow to Initialize

[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


Does anyone know any ways how I could accomplish this?

Thanks

How to trigger the OnEndEdit event for a InputField (e.g. by a button click)?

$
0
0
I have a InputField and a button to submit it in a scene with new UI.
Via Inspector, the InputField's OnEndEdit event is setup to call a method.

Now I would like the button to fire the OnEndEdit event of the InputField somehow.
Is that possible? I couldn't figure out a way to do that, but I wasn't using the new UI yet.

I know there are workarounds but I'd like to learn using the Event System, too.

"Blocks Raycast" in Canvas Group necessary for gameObject to be Interactable?

$
0
0
I have a large instagram-feed-like scrollview (actually InfiniteScroll) and I want to have an invisible button blanket layer over each card in order to know when people are trying to tap on the different cards. However, I also want users to be able to play/pause some the cards that play music or video etc.

It seems that if I add "Blocks Raycast" + "Interactable" and to the Canvas Group of the invisible button blanket over top of the card, the button blanket receives the interaction click no...

"Blocks Raycast" in Canvas Group necessary for gameObject to be Interactable?

Creating unity textmesh dynamic list scrolling viewport

$
0
0
I have and array of generated data that I can display in a textmesh box. I put that gameobject in a scroll viewport content parent. The data fills the textmesh box and displays in the scroll viewport but it is darkened and the vertical scroll bar doesn't work. In scene view I can see the data list but can not scroll in game view.
I have followed the lessons to a T and my hierarchy is the same but the scrolling and bright display are not there.

Free Script - Particle Systems in UI Screen Space Overlay

$
0
0
I haven't been too active in the Unity forums, but I am a professional dev who has been working with Unity for several years. I've recently been working with the superb new team at Section Studios in LA, to create a stellar new mobile action-RPG.

We've been confronting and tackling many interesting issues, trying to create cutting edge effects and gameplay for the mobile platform. My goal is to eventually publish a blog with some of my results, but for now I thought I'd start by posting...

Free Script - Particle Systems in UI Screen Space Overlay

Does the Content Size Fitter work?

$
0
0
I'm making a dialogue bubble where it will automatically resize the bubble to the text's size.

I have the content size fitter attached to the background image.

But if the Text overflows, the background image doesn't change size!

Does the content size fitter not work with TextMesh Pro?

How can I keep the aspect ratio of a sliced image?

$
0
0
Hello everyone!

Sliced images are great! But they are currently unusable for me without the ability to set the aspect ratio. Is there a way to set a custom aspect ratio for sliced image? Any help is appreciated!

Code Snippet: Size RawImage to Parent, keep aspect ratio.

$
0
0
Here's a handy little script I came up with, so you can tell any RawImage to fill it's parent's Rect, while maintaining the aspect ratio of the src texture. It also supports %-based padding, and images that have been rotated by 90 degree increments.
Code (csharp):
  1.  
  2. static class CanvasExtensions {
  3.     public static Vector2 SizeToParent(this RawImage image, float padding = 0) {
  4.         var parent = image.transform.parent.GetComponent<RectTransform>();
  5.         var imageTransform =...
Code Snippet: Size RawImage to Parent, keep aspect ratio.

Unity UI showing in Editor, but not in Build

$
0
0
I should start by saying that I am new to UI in general. Never touched the legacy GUI UI in Unity before.

I am using the new Canvas UI system. I have set the canvas to 'Render Mode: Screen Space - Camera' and linked the Main Camera to it. I have positioned Text elements to the Canvas and positioned them where I want. Everything looks good when I run in the editor; however, after building and running as a desktop/web app, the UI does not show up.

UnassignedReferenceException: The variable m_sharedMaterial of TextMeshProUGUI has not been assigned

$
0
0
TMP from package manager: preview.3 - 2.1.0, and yes I already reimported the essential resources:
View attachment 547719


I get a ton of spam for this error on scene startup and editor startup, it also happens when building the project from the command line.

Code (CSharp):
  1. UnassignedReferenceException: The variable m_sharedMaterial of TextMeshProUGUI has not been assigned.
  2. You probably need to assign the m_sharedMaterial variable of the TextMeshProUGUI script in the inspector....
UnassignedReferenceException: The variable m_sharedMaterial of TextMeshProUGUI has not been assigned

Full Emoji Support Api (emoji Sequen

$
0
0
Hello guys, i want to share this improvement API to TextMeshPro

This package will include all you need to support all Emojis of Android/iOS in you app (Unicode Emoji 12.0)

The original TextMeshPro use unicode characters to try map Emojis, but this is problematic because in Android we have a huge amount of Emojis that use Char Sequence.

Thats why you need this API.

CURRENT VERSION: 1.0.5

NEW INSTALL GUIDE (Package Manager Unity 2019):
  • Delete old versions of this...

Full Emoji Support Api (emoji Sequen

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

(Need Help) Keep word wrapping but prevent overflow

$
0
0
Hey all, I'm working on an interactive fiction with lots of text in a vertical format (designed for mobile). Each new paragraph adds to the Story Textbox based on variables, so it's not like everything is all ready to go at once.

Sometimes the new text overflows out of the TMPro margin's/textbox area, never for the first paragraph and usually gets worse (i.e. overflowing more and more) with longer sections. Obviously this system worked fine with vanilla Text since it couldn't overflow so...

(Need Help) Keep word wrapping but prevent overflow

Textmesh Pro broken after update

$
0
0
A couple of weeks ago I upgraded from a 5.5.4 version of Unity to 2018. There were errors with Textmesh Pro but I opted to delete the new packaged version and run with the old version. That seemed to work fine, but I've since noticed that I cannot edit any text.

When I select an object that has the TMPro UI component, this happens:


The first error looks like this:
Code (CSharp):
  1. NullReferenceException: Object reference not set to an instance of an...
Textmesh Pro broken after update

Getting the text without tags

$
0
0
Hi,

I've seen dozens of posts on the subject but none too recently. For a multiplayer chat functionality, I'm trying to remove all rich text tags from the TextMeshPro text value that a user type. I actually don't need any tags at all, so the point is to really clear the user-entered string. I can't put the resulting text as not being rich text, as I will be adding tags from the server-side, so all I want is to clear all tags from the input text.

Problem is, most of what I've seen online...

Getting the text without tags
Viewing all 23263 articles
Browse latest View live