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

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

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?

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?

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

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

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!

New Sprite Atlas + UI?

$
0
0
So in 2017.1 a new feature was released by Unity, the Sprite Atlas:
https://docs.unity3d.com/Manual/SpriteAtlas.html

In addition, the Sprite Packer is now marked as "Legacy" in the project settings --> editor settings.

In NGUI, you could also create atlases. Then, you would create a UISprite component and directly reference an image inside the atlas. There does not seem to be any component like this in Unity UI!

It seems like a core feature that the atlas needs, ESPECIALLY...

New Sprite Atlas + UI?

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 !

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

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.

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
Viewing all 23263 articles
Browse latest View live


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