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

Previewing a TextMeshPro in an EditorWindow

$
0
0
Hello there !

I could have posted it in the Editor Extension section, but I think someone who used UnityUI and TextMeshPro will have a better idea. :)

I'm writing a tool to have a centralised database of all the TextMeshPro styles used in a project, and to avoid the users to stray across the different scenes to see the result of each change they are doing, I'd like to render a kind of preview window directly in the tool.

The issue is, I quite have an idea on how to do it.

The best idea I...

Previewing a TextMeshPro in an EditorWindow

How to break up TextAlignmentOptions between horizontal and vertical?

$
0
0
Hey there.

I'm having some issues understanding how the alignment options works. As it is, the TextAlignmentOptions enum is a mess. It possess the 36 possible horizontal and vertical combinations, but there is no explicit way to get only the horizontal OR the vertical alignments.

I want to have two enum popups to setup the text alignment in a custom editor, but the way it is done, I just cannot split them without passing by some huge comparison tables.

Is there a way to split and merge...

How to break up TextAlignmentOptions between horizontal and vertical?

How to change position of prefab buttons in script?

$
0
0
New to Unity, just trying to make a 2D character creator. Everything is working great I just can't position the button prefabs where I want them.

My code is:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using UnityEngine.EventSystems;

public class UIManager : MonoBehaviour
{
public int maximalRows = 4;
public int currentColumn = 0;
public int ButtonCount = 0;
public RectTransform btnPrefab;

private...

How to change position of prefab buttons in script?

WebGL Copy - Paste for Input Field not working

$
0
0
Hi there,

I am using Unity 2017.1.0p4 with TextMesh Pro from the Asset Store in WebGL.
I am facing an issue with Copy - Paste. I am not able to copy something from outside the WebGL window inside an Input Field but it works if I copy something from Unity and past it inside the input.

Is there any way to fix this ?
Thanks a lot !

[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?

[5.2] Terrible performance spike causing by Font cache

$
0
0
[Unity 5.2.3p2 seems to fix the problem, thanks Unity !]

Hi again, I'm continue to port my project in Unity 5.2

I notice a terrible game freeze when open my UIs, due to "Font.CacheFontForText", which taking 3273ms (!), vs nothing in Unity 5.1.3. My UI doesn't contain a ton of text so... What's going on ? Does something change about using Text on UI in term of best pratices ?

[​IMG]

Hololens - Text only visible for one eye

$
0
0
Hey,

When I view a tmp ui text label on the hololens it is only displayed on the left eye, which makes it look quite strange!

I have a Canvas set to world space and added the tmp text by right clicking.

Is there some setting I'm missing?

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

[Script] Simple script that automatically adjust anchor to GUI object size (Rect Transform)

$
0
0
I have been playing around with the new GUI in 4.6. I have found out that there is no automation that allows the user to surround a GUI object (panel, button, etc.) with anchors on all sides. This would effectively make GUI object scales and stay at the same position relatively to the screen size. Therefore, I wrote a simple script that help me do that, hope this help,

Note: This only applies to GUI object with parents.. do not apply it on the root canvas...

[Script] Simple script that automatically adjust anchor to GUI object size (Rect Transform)

Using return values from Methods as argument for Events

$
0
0
Hi,

Is it possible to have events accept return values from methods as an parameter rather than having to "hardcode" a string for example?
I could pass a script so the method the event calls gets the desired value itself.

But that's not very practical :/

I would like to pass a variable or a method with a return type.

Making it a bit more dynamic without having to write scripts to have this behaviour :)

I would try to extending the event system or something like that if that's possible....

Using return values from Methods as argument for Events

Issue multi touch on 2 tactical screens at the same time

$
0
0
Hello,

I am on a project where the purpose is to use 2 tactical screens and displaying on a 3rd.
The displaying part is Ok with the feature Display.

Moreover, I can multitouch both screen but
if I keep touching a screen, the other one don't receive any input.

I tried with the 2 camera and canvas / one camera one canvas and no use of the display mode but both methods didn't achieve what was aiming for.

Here is a package demonstrating my issue.

Thx in advance for any replies.

Insert specific characters in fonts

$
0
0
Hello, this is my first post on the Unity Forum :)

after searching for a while, i cant really figure if there is a way to import, or add specific images (icons, in my case) into the font. Because, i would like to put a Locker, or Edit icon in my text area, i need it to do it directly in the font if i want to be able to keep the center justification of the text + the icon ( i cant hard write it, as the text is going to be localised )

Thanks !

child objects blocking scrollrect from scrolling

$
0
0
i am making a desktop application, i would like the user to be able to scroll the scrollrect by clicking and dragging, even over other objects with event system components.

Basically:
user can click on the child objects inside the scroll rect with a click event
if user clicks down and drags, scroll rect should scroll and click up should cancel

sort of looking for mobile style functionality.

any thoughts?
Thanks

Virtual Cursor & Input

$
0
0
Looking for a way to create and control a virtual cursor.

I can move a cursor around the screen but simulating inputs like hover, clicks, etc is where I'm running in to trouble. Additionally, it needs to be crosss platform because I'm using platforms that don't normally have a cursor.

I've tried some scripts I've found around the web without any luck.

Does anyone know of anything I'm not finding or have any snippets that have worked for them?

Thank you!

Long press gesture on uGUI button?

$
0
0
I can only see OnClick() method on button.

How to do a long press gesture on button or other gui elements?
Just like in Windows 8 , a context menu will be shown when long press on some element.

Or can OnClick() does send press duration to assigned method?

Or can EventTrigger solve my problem?

Curved UI for VR

$
0
0
At the moment I'm trying to figure out how the curved UI is done in certain VR apps. A good example is the interface of Discovery VR for the Oculus Rift and some other applications.

I tried to search a little and found out there are assets doing this stuff. But I want to know how exactly this can be done. I read some posts on the Unity forums about that it needs to be done with shaders and other about manipulating the meshes of the canvas or something.
Also I found some sourcecode, but it...

Curved UI for VR

Multiline input field with scrollbar scrolls all the way up on first scroll

$
0
0
Hi,
Here is the behavior i am seeing on Unity 5.6.1f1:
I have an empty TMP input field set to "multiline new line" that has an attached scrollbar.
I type in enough text for it to become scrollable (e.g. a bunch of newlines) and then use the mousewheel to scroll.
The text and scrollbar will then jump all the way back to the top instead of scrolling from the current position.
After that it behaves as expected scrolling up and down.

Hope there is an easy fix for it. I can provide a simple...

Multiline input field with scrollbar scrolls all the way up on first scroll

How to hide 3D Text

$
0
0
First off, I don't know if this is the correct place on the forum for this. I'm assuming because Text in my mind is a UI thing. Second, I am having trouble having text get obscured behind other objects. Which is annoying. I don't know how to change it and when I searched for answers, I got old, outdated answers. (Answers were from 2013/14) When I try things, the Font Material is greyed out and it's annoying me.

Can you create dynamic panel sizes without scripting?

$
0
0
I have found a YouTube video on how to do this through scripting however I would like some advice to find out if this can be done through the built in Unity layout features.

I have canvas that has two panels, one on top of each other. The bottom panel consist of a bunch of buttons, in grid mode layout. The top panel has text with a scrollbar.

When buttons in the lower panel are hidden, the row drops towards the bottom of the screen (exactly what I want). The reduction in panel 2 creates...

Can you create dynamic panel sizes without scripting?

Ability to add enum argument to button functions

$
0
0
A feature I would love to see is for buttons to be able to call functions with an enum type argument for instance...

Code (csharp):
  1.  
  2. public enum type {
  3.   fire, water
  4. }
  5.  
  6. public void SetType(type t) {
  7.   //content
  8. }
  9.  
Currently buttons don't acknowledge these functions as being available. It would be incredibly nice if we could not only see these functions, but assign an enum value to pass in.
Viewing all 23263 articles
Browse latest View live