#šŸ“²ā”ƒui-ux

1 messages Ā· Page 29 of 1

serene tusk
#

like this

#

Slider Property Manager is a vertical layout and so is Content

supple basalt
#

in this case, I would have the slider declare a minimum height that's large enough to show it correctly

mortal robin
supple basalt
#

However, you could put a vertical layout group onto SliderObject and have it control child size

#

If you did that, it would ask for enough space to show Slider

#

Slider would then need to ask for enough space.

serene tusk
#

yeah that's what I'm doing

supple basalt
#

I have plenty of places in my UI where a layout group controls a single child

serene tusk
#

Strangely my text is resizing but only up to a certain point

supple basalt
#

you may need to change the min and max size on the text component

supple basalt
#

It can cause some very annoying behaviors

serene tusk
#

the text object

supple basalt
#

You'll have to show me

serene tusk
supple basalt
#

Do you want the text to get even smaller when this happens?

#

If so, you need to reduce the minimum size on the TextMeshProUGUI component.

serene tusk
#

No I just want the object to get taller

supple basalt
#

ah, okay

serene tusk
#

If it gets too small it will be unreadable

supple basalt
#

In that case, you need to use a ContentSizeFitter to make the entire window grow to fit its content

#

That's where you use a fitter -- when you have no parent layout group

serene tusk
#

but it does have a parent layout group

supple basalt
#

I'm talking about the entire popup window. Does that have a parent with a layout group?

#

Oh wait -- isn't this supposed to be a scroll view?

#

Yeah, I get it

#

Put a ContentSizeFitter on the "Content" object

serene tusk
#

It has one already

supple basalt
#

God only knows why this isn't there by default

#

okay, and is it configured to use the preferred size?

serene tusk
#

but sliderPropertyManager also has a vertical layout group

supple basalt
#

That's fine. Content will also need a vertical layout group, though.

supple basalt
#

Otherwise, Content will have no idea how much space to take up

serene tusk
#

they both do

supple basalt
#

Show me the inspector for Content

serene tusk
supple basalt
#

You are not controlling the child's height

serene tusk
#

Oooh yeah thanks that fixed it

supple basalt
#

This means that Content cannot resize its children to be taller or shorter

#

I would default to controlling child size and using child scale in both directions

#

and not using Force Expand

serene tusk
#

Ok

#

The text doesn't squish at all now but it's better than it overflowing

supple basalt
#

Yeah -- it's going to ask for enough space to display at maximum size

#

I believe this is the order of operations

#
  • The layout system asks how much space it wants
  • TMP calculates space for its maximum possible size
  • The layout system gives it some space
  • TMP calculates a size based on that space and where it can break lines
#

I'm not sure how you'd make it reduce the size first, then start expanding the Content area

#

Maybe you want to use Min Size instead of Preferred Size on the content size fitter?

serene tusk
#

I end up with this then

#

I'll just always make it small

supple basalt
#

Interesting. Let me try that

serene tusk
#

The text is only showing because I set it to overflow, if I set it to truncate then it is invisible

supple basalt
#

Ah yeah -- it looks like the text component gives you a min height of 0

#

You could give the text object a LayoutElement to set a min size, which looks pretty good, but then it won't start growing once the text component hits its minimum font size

#

since the content size fitter is looking at the min size, not the preferred size

misty basin
#

I'm trying to use Textcraft Styles, such as this. I can extract hex color from the image, but the hex color changes in each pixel. I currently have the font in a .TTF file, but i have no clue on how to extract the style or get it from Textcraft. Anyone know a way to get the style from the image, or recreate the style. (second picture is from my game with the font asset)

boreal remnant
#

How can I get this look while being able to change the text at runtime?
The problem are the big quatation marks. I've been playing around with TMP tags but this is the best I could get:

<size=115><line-height=51%><voffset=-0.3em><color=#C08676>ā€œ</color></voffset></line-height></size>Despite my previous experience characterizing and injecting botulinum toxin type A in monkeys, it was still an emotional experience to inject that first human patient. I didn’t know if I’d be able to keep my hand steady for the injections. <size=115><voffset=-60><color=#C08676>ā€</color></voffset></size>

misty basin
#

yo Vice, you could just make the quotes a image with % size of container

#

and add padding to the text

boreal remnant
#

if the last line ends with one word, the closing quotation mark needs to be all the way on the left side, next to that word

misty basin
#

or just make 2 containers for the text in that big container, with the 2nd one being for only the last line of text

rain gust
#

I got a question, maybe someone can help me cause I struggled to learn this thing. How does UI work and how to make an UI thats immune to any resolution. Like If I put something in the middle, I want it to remain there no matter what. Like Custom things cause If I wanted on the center or the edges I would anchor it.

#

Anchor it in a place and then move it with position does not help cause at different resolutions, it causes damage

cursive stag
#

is this a bug
in game and scene view i have only 2 buttons but on simulator too many buttons , im using LTS version tho

#

if anyone know please help

frail knoll
#

Could of warned us headphones users Shiba_Cry

low pike
sudden veldt
mortal robin
#

Or maybe a Tree view

sudden veldt
#

it is dropdown only but i am lagging to getting exact same

serene tusk
mortal robin
#

Click on the event system while the game is running

#

and see what it thinks your mouse is over

serene tusk
#

I can press other buttons and gridcanvas is set to none

serene tusk
mortal robin
#

look at the preview window (bottom of the inspector) when you have it selected

serene tusk
#

I think that only shows what's selected, which I can select the slider

thin canyon
#

I've got a UI issue.
The red bar is a select-thingy, and it can fill the space of any element inside this menu here.
In start, I want it to fill the first element, when I do so though, it doesn't align correctly.
This is done in Start, so I'm assuming there's something that UI does during start (either recalculating anchors or positions whatever) that disrupts the code.
The code is quite simple. All it does is align itself with any RectTransform without being a child:

private void FillRect(RectTransform t)
{
    int stealIndex = t.GetSiblingIndex();

    if (t.parent == transform.parent && stealIndex > transform.GetSiblingIndex())
    {
        stealIndex -= 1;
    }

    rect.SetParent(t.parent);

    // Place just above the transform we're interacting with
    rect.SetSiblingIndex(stealIndex);

    rect.anchoredPosition.Set(t.anchoredPosition.x, t.anchoredPosition.y);
    rect.pivot = t.pivot;
    rect.SetPositionAndRotation(t.position, t.rotation);
}

I run this code in Start, and it ends up looking like image number two.
The X and Y coordinates are off, as well as the anchors.
Any ideas?

#

I am using a Vertical Layout Group for the element it should fill, so it might have something to do with that.

supple basalt
#

#šŸ’»ā”ƒunity-talk message @wispy dew -- to elaborate on this, your canvas is in "Screen Space - Overlay" mode.

This draws the text directly onto your screen. The apparent position and size of the text in the Scene View doesn't matter.

#

Basically, if you put something at X=100, Y=100 on an Overlay canvas, it appears 100 pixels from the bottom-left of the screen

#

Have a look at the Game View window

slim flare
#

@supple basalt heres my project in free aspect

#

and yeah the boxes arent aligned anymore

supple basalt
#

hit F to focus on that button

#

that'll do it

#

hm, so you need to line up properly with parts of the sprite?

slim flare
#

yup

supple basalt
#

You could consider using a world space canvas instead of an overlay one. That way you can just directly position everything, and it won't move at all as the screen resizes

slim flare
#

ooo

supple basalt
#

You just have to make sure that the start and quit buttons are actually visible to the camera

#

Oh wait

#

that's not a sprite renderer; the background is an Image

#

I was mistaken

#

Okay, here's what you'll do

supple basalt
#

It's just an invisible box

slim flare
#

just invisible yeah

supple basalt
#

okay, so we're going to adjust how it's anchored

#

Right now, it's set to not stretch at all, and to be positioned relative to the center of its parent

#

We're going to use a custom anchor setup here.

supple basalt
slim flare
#

doesnt look like it

supple basalt
#

do you have Preserve Aspect checked on the background, then?

#

I was expecting it to be changing proportions

slim flare
#

where do i find that?

supple basalt
#

look at the object with the Image component on it

#

probably the background one

slim flare
#

ah yup

#

not checked

supple basalt
#

as the canvas changes size and shape, the background image stretches to fill it

#

and the button correctly follows along

#

Is that how the background reacts as you resize the game view?

slim flare
#

is there a way to move the entire view like that?

supple basalt
#

pop out the game view and resize the window

slim flare
#

ah

supple basalt
#

I was demonstrating on a World canvas to make it easier to show the editor gizmos

#

but it's the same principle

slim flare
#

the size looks like it stays the same, the position just changes

supple basalt
#

In this case, the background image has been set to fill the canvas. That might not be what you have

#

Can you show me the inspector for the background?

#

I mostly need to see the RectTransform

slim flare
supple basalt
#

Okay, so the background image is set to fill all of the space its parent provides

#

it's stretching on both axes and left/top/right/botttom are all zero

slim flare
#

yup

supple basalt
slim flare
#

i can try to screen record

supple basalt
#

Basded on what you've shown, here's what you should do

#

Go to your button object and set it to stretch on both axes

#

Set left/top/right/bottom all to zero

#

The rectangle should now fill the entire canvas

slim flare
#

yup!

#

both buttons?

supple basalt
#

then, press T to activate the Rect tool. you should see this, with four blue dots and some white arrows at the corners

#

Drag those arrows to fit the button you see on the background image

#

Then set left/top/right/bottom to zero again (the editor will have adjusted them to compensate for this change, and we don't want that)

#

This will be the result

#

This makes the button take up a certain percentage of the screen, basically

#

It's not 300 pixels from the bottom. It starts 10% from the bottom and ends 20% from the bottom

#

This will make it exactly match how the background stretches

supple basalt
#

Note that it's probably easier to just separate the button sprites out from the background!

#

I should've mentioned that earlier...

slim flare
#

that worked!!!!

#

thank you so much omg FWMCHeart

supple basalt
#

It now says "Custom" because this is a bit of an unusual setup

#

You usually have either no stretch or 100% stretch

#

compare your background image's Anchors to the button's anchors

#

The first one means the background stretches from 0% to 100% on both axes

#

the second one means it stretches from...about 30% to 40% on both axes

slim flare
#

thank you!!

supple basalt
#

no prob (:

supple basalt
slim flare
#

this will be very handy MocoPray

thin canyon
#

there is technically a "solution" which is to just run the code in Update instead. The first frame is strange, but the rest should be fine.
I dislike this though, as I'd prefer not to have it running in Update. It's not needed.

last pollen
#

Hey folks! šŸ‘‹
Not sure if this is the right place to ask but here I go....
I work as a UI artist in a studio that uses a very old in-house engine.
I'm in my junior to mid stage of my UI journey and I don't have any experience with implementation, scripting and anything like that with any popular engines.
I would love to start learning Unity since it looks like it's more beginner friendly then Unreal, but I'm not sure where to start. I have zero experience with code and scripting.

I would like to learn how place the actual ui elements in a Unity canvas, simple transform animations, understanding Unity animator parameters, maybe some basic particles VFX, different Unity Ui component helpers, asset export, prefab workflow, etc... this list would be my end goal.
I know there's TON of tutorials out there and I'm overwhelmed with choice.

Is there a structured course that is made for UI designers/artist in mind I can follow?
Any info would be helpful!

velvet torrent
#

What is the a good way to implement Diegetic UI into this 3D Model? Can I exchange Textures or should I put the UI 1mm on top of the Screen

low pike
pliant ether
#

Does anyone have any resources regarding writing a custom event system?

devout hearth
#

guys is there any way to insert a button into text mesh pro?

#

like, i need a way to insert it into text itself, it has to be dynamic

#

for example

supple basalt
#

You could insert a sprite and then add a Text Link

devout hearth
winter valve
#

does this look good?

pine lark
#

how do i handle this when dealing with higher screen resolutions than planned?
i did up my entire scene specifically aiming for 1080p

#

i'm perfectly cool with all the UI elements just... staying in the same place

#

instead of trying to stretch with the screen

#

and i can just make that green texture expand out a bit

#

i'll figure it out. suggestions would b helpful though

small grove
#

Hi, I was wondering what the proper way to have any image envelope the canvas is whilst keeping the aspect ratio?
I tried using envelope parent with a custom aspect ration, however, that doesn't work since not all the images will have the same aspect ratio.
What'd be the proper way to go about this, a custom component or sm?

small grove
# small grove Hi, I was wondering what the proper way to have any image envelope the canvas is...

I was able to achieve this effect by doing the following in the code:

var systemSprite = Misc.SpriteFromFile(image);
_systemImage.sprite = systemSprite;
var rect = systemSprite.rect;                
_systemImageARF.aspectRatio = rect.width / rect.height;
_systemImage.gameObject.SetActive(true);

But this only works if you are loading the image via code, is it possible to achieve the same result in editor with an already existing component?

pliant ether
# winter valve does this look good?

Hard to tell with how rough the text. I’d give the elements some more margin, with the buttons and tabs being too close to the tab on the left.

#

If you (reasonably) don’t want to spend money on Illustrator, try Inkscape for vector graphics. It’s a pretty cool Foss alternitive

#

Also, if text on the left column is green, be constant, and give the text on the right the same colour

raven karma
#

Putting this here as I have no idea where I can talk about text. I don't know why I can't see my UI text or why I can't change my fonts.

winter valve
winter valve
winter valve
#

thanks for your help

pliant ether
winter valve
pliant ether
#

Do buttons have USS substyles for when they are being selected by a gamepad?

supple basalt
rose pond
#

@pliant ether wdym old ui system

pliant ether
rose pond
#

i'm using the default unity ui

pliant ether
rose pond
#

i'm not sure what you mean, i'm using the default unity ui package, and it has components

pliant ether
rose pond
#

well it's not just messing up the sizes, it also doesn't even display some elements

#

and yes i did put a canvas scaler on the canvas

#

been searching for hours, i think it's a unity glitch

#

yeah as i thought

#

i set the canvas to world space

pliant ether
rose pond
#

built, now the game is stuck in the splashscreen

pliant ether
lapis river
#

hello, I have a problem. I made a child image on my button, top left anchored. Issue is when button goes to left, image goes to right side to the middle. At most right of the canvas it works properly what is the problem? I cant solve

mortal robin
lapis river
#

I fixed somehow

brave tide
#

Does anyone know how I can import asian characters in a TMP font?

#

I've been trying every which way to add japanese localization but nothingworks.

I've added custom character lists, fonts that aparently support japanese and much much more but I am at the end of my rope here

limpid iris
#

I’m really new to unity and I want to program a simple start button that will change the scene when I click on it, but I heard that I should use ā€œUnityEngine.SceneManagementā€ but I’m getting an error code that says that there is no namespace called ā€œSceneManagementā€ under UnityEngine I’m so confused can someone help

#

I just want to get this finished and go to bed but I’ve been stuck for too long

limpid iris
#

If it helps this is what my code looks like

#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger : MonoBehaviour
{
public void ChangeScene()
{
SceneManager.LoadScene(ā€œSceneTwoā€);
}

#

I forgot to copy the last curly bracket oops

#

I don’t know if it’s my code or not because my error is saying that I don’t have ā€œSceneManagementā€ as a namespace under UnityEngine

azure flame
#

Is that what IDE telling you?

#

@limpid iris Make sure you have !ide installed properly so it has Unity integration.

onyx flowerBOT
limpid iris
#

I’m using visual studio 2019 and it’s not showing that I have a syntax error or anything like that

#

It might be because I’m using an outdated version of unity but I thought that it would still work the same

azure flame
#

You should be running latest minor version at the very least and update to VS 2022, you can install it from the Hub all the integration will be installed properly for you.

limpid iris
#

I’m using unity 4 because that’s what my school has on their computers

limpid iris
#

And might as well change to unity 6

#

I’m gonna let it download and try again in the morning

low pike
limpid iris
#

I’m switching to unity 6 rq because why not

low pike
#

4 -> 6 is massive change, expect lots to break

#

back up with version control before starting

supple basalt
supple basalt
#

that's catasatrophically outdated

limpid iris
#

Ik 😢

brave tide
supple basalt
#

Yeah. I'm not sure how it'll behave like that

#

I'd expect it to union the two sets of characters, but who knows

proud sandal
# brave tide so should I remove that and just have the custom character list?

ideally you specify the glyph ranges in hex and not provide a sample text

you can use this page for reference https://www.unicode.org/charts/

you can also set the asset to dynamic and glyphs will be added automatically to the asset when used. When done (project release), disable the dynamic toggle.

also if you use the NotoSansCN (chinese) version, you get absolutely everything in the source font, including japanese and all the western languages.

timber fossil
#

Hey does anyone have a good resource to change geometry in unity gui?

#

i want to create a 1 side rounded fill timer

#

something like this

supple basalt
mortal robin
#

You can make such graphics in photoshop or a vector format and import to Unity

supple basalt
#

You can't just use a horizontal fill

mortal robin
#

as for drawing the bar - I would use a shader

supple basalt
#

yeag

#

A custom shader would let you compute which pixels are filled and which pixels aren't for a more complex shape

timber fossil
#

yea but is there any resources to start on shader?

mortal robin
#

plenty

timber fossil
#

i have no knowledge on shaders

supple basalt
#

Modern Unity versions let you write UI shaders with the Shader Graph

timber fossil
#

yea I have tried using them but since i lack any basic understanding of shaders I was not able to achive my desired result

#

I just need some documentation about shader dealing with bended UI

supple basalt
#

Something that comes to mind is a "fill texture"

#

It would have a color gradient ranging from black to white, where the color tells you how far along the bar the pixel is

#

I'm not sure how you'd create that gradient, though

timber fossil
#

ok I will lokk into it

#

thank you

mortal robin
supple basalt
#

It might have problems with longer bars, since you only have 256 colors to work with

#

I guess you could use 16-bit color

mortal robin
#

you could use all four color channels and treat the value like a 32 bit int

#

don't worry about what that looks like in the texture 🤣

#

or how to create such a thing

supple basalt
#

I did consider that, yeah

#

at that point you might as well just use a 16 or 32 bit color format

#

(with one channel)

upper wigeon
#

Hey, I am making a mobile game with TextMeshPro and plan to add multiple languages (Latin, Cyrillic, Japanese, Simplified/Traditional Chinese and Korean) but I am not sure how to make the Font Assets properly and their Fallbacks.
I am using Fira Sans font which covers Latin + Cyrillic, Vietnamese, etc. I'm not sure whether to create a Font Asset using Unicode Range (hex) and include the characters of all the font languages I'm interested in and use it as main font, or otherwise create a font asset Extended ASCII as main font, and then create different font assets using Unicode Range (hex) for each different alphabet (used as Fallbacks).

About whether to create the text fonts in static or dynamic, my idea is to create them in static and then make a Dynamic of all the font characters that will be used only in input fields. For the other alphabets (Japanese, Korean and Chinese) I know I should use different fonts, but should they be static or dynamic?

Finally I would like to know which Render Mode to use (SDF, SDFAA, SMOOTH, etc) for the font Assets and if I can edit the atlases in photoshop to add custom shadows/outlines, or is that considered a bad practice?

high walrus
#

will layout element guarantee ur UI width at least having the width of minimum width?

#

because mine isnt

#

i expect if i fill in 200 in min width, it will be 200 if its not heavily restricted by other components

proud sandal
#

a complete font asset including all ideographs from Chinese requires a 4k by 8k texture at a usable font size. You can use dynamic mode to figure out which characters you need. But it’s unreliable.

#

If you want to use a second font for your ideographs, you can make an asset just for those and define it as a fallback in the main font. You can also split assets into multiple smaller textures. I don’t think that saves any memory though but may work around texture size limitations.

#

Usually you can put all your western alphabets into one asset/texture

celest lodge
#

why is creating a dropdown look so malformed like this? i have the item selected and its really badly formed

#

okay for some reason all the scales are 1.9893

#

and the positions are off

#

wtf

upper wigeon
proud sandal
upper wigeon
proud sandal
upper wigeon
upper wigeon
proud sandal
burnt shard
#

I was curious guys would you use Ui toolkit at this current stage?

#

or you would use more standard gui system

#

I would mean in a runtime context

proud sandal
burnt shard
proud sandal
#

It will certainly be the recommended way. whether that turns out to be smart, we’ll never really know. Its main issue is the same as with most MVVM frameworks: they are complex generic solutions to millions of specific problems and force the user to dealing with that complexity without really giving them much (affordable) opportunity to mold the system to their actual needs.

burnt shard
#

yehhh

#

also the fact they dont have a grid

#

this one was kinda of a let down so far

proud sandal
#

It’s always the same with these things they are great at solving easy problems but don’t actually solve any difficult ones

burnt shard
#

well css is great at what it does

#

in general

#

just unity dont implement half of it

#

like css-grid is a two flag

proud sandal
#

It’s powerful in theory but does make it very hard to create good ui for the average user/designer

#

Because it offers zero guidance and few constraints

proud sandal
burnt shard
#

I know I know

#

grid should be there as basis tho xD

proud sandal
#

Just look at the millennia of development time that have been put into the chromium renderer

proud sandal
burnt shard
#

XD

#

yeh

#

pretty much

#

I know they working on implementing it

proud sandal
#

it’s also very OOP in a composition world

#

and it’s always fun to docRoot.Q(ā€œmy buttonā€) as Button nothing wrong with that šŸ˜µā€šŸ’«

burnt shard
#

yehhh

#

I heard they working on that

#

I think the worst is

#

anchor in ugui

burnt shard
#

but since my game is veryt simple

#

ill try ui elements

dry crow
#

Heya, I'm trying to use a scrollview to horizontally display these items. They are loaded dynamically but for some reason on top of each other.I have a content horizotnal layout group and content fitter. Im very confused as to why they dont space out

low pike
#

What's the setup?
What position do you spawn them at?
Do you have a layout group?

dry crow
#

the items do spawn correctly as children of Content gameobject

low pike
#

I forget which eactly, tick the width for one of these

dry crow
low pike
#

the parent of the thing that is spawned - ClothingB... what's on that?

#

show the inspector

dry crow
low pike
#

that's why it's not working

#

There's no rect transform, and the size of that is .. I dunno what it would be for the UI, 0?

#

The conent isn't expanding because the children aren't big enough to make it expand

dry crow
#

so I should put a rect transform on the prefab?

low pike
#

Yes, that is what I'm saying

#

and give it a size (width/ height)

dry crow
#

let me see

low pike
#

Pretty much all UI elements should have a recttransform

dry crow
#

I see. That seems to have worked. Awesome, tyvm

dry crow
# low pike Pretty much all UI elements should have a recttransform

Well, here's the next issue. I wanted to have this placeholder guy show up to apply the clothing items to, and in the prefab he seems fine, but in the scene when i add the prefab he's just invisible? I gave this prefab a rect trasnsform too. I thought it was a later issue but even when i drag him out of the ui he is invisible

low pike
#

pls don't crop screenshots, you cut off lots of information

dry crow
#

The sprite img is full rect

low pike
#

it's a sprite renderer, that's not for UI, that's for the game (world space)

dry crow
low pike
#

the same as everywhere else for UI - Image component

dry crow
#

oh

#

that...makes sense

low pike
#

Just FYI - if you drag a sprite from the project window into the scene, it creates a sprite renderer game object. When creating UI, you can't do drag/drop - you must right mouse click -> ui -> image and assign the sprite to that

dry crow
low pike
#

add it wherever you want - wherever it makes sense for your thing

dry crow
#

i added it as a component and its entirely invisble awkwardsweat

low pike
#

Just remember, UI is drawn in hierarchy order.. from top (first) to bottom (last)

dry crow
#

yes

low pike
dry crow
#

so ill up the rect transform

low pike
#

it's currently 2px by 6px

dry crow
low pike
#

it's not on a canvas in that prefab

dry crow
#

I see, so when it gets added to a canvas in the scene it should draw

low pike
#

I would expect so

#

save -> close and reopen that prefab, it may add the temp canvas so you can see it

dry crow
#

yes it did, oh god i feel so silly

low pike
#

and when working with UI, press T to use the UI gizmos

dry crow
#

thank you again šŸ˜…

dry crow
#

Hi, I'm trying to get this dropdown to expand further than this so the text stops overlapping?

supple basalt
#

the default dropdown should already be able to do this -- have you been making changes to it?

scarlet jetty
#

How can I add support using the new input system to navigate left and right using gamepad bumpers?

burnt shard
#

@proud sandal ok yeh once u get used to the workflow it is actually pretty nice to work with ui toolkit. even created myself an base class that reduce my boilerplate

brave tide
#

Plus, I have no idea what to do with this information. Do I just copy all of this and throw it into the text box?

brave tide
#

Unless there is some way to use the source font, instead of SDF, but I do not know how, other than to scrap TMP and use the built in stuff

proud sandal
proud sandal
brave tide
#

What asset creator are you refering to?

proud sandal
#

And ofc you will loose glyphs, you only want to include the ones you use.

proud sandal
brave tide
#

I see

#

Thank you

#

I will try again with the fonts, and try to implement the HEX codes. Thank you for the help

proud sandal
burnt shard
proud sandal
#

Then I really wonder why people are so hyped about it. This will constantly break ui code and end up being annoying to fix. Is there seriously no form of statically validated databinding or code-gen for runtime?

celest lodge
#

If i'm navigating with a controller, and then click nothing with a mouse, the selected becomes null. How can i recover that selected again?

celest lodge
mortal robin
#

I should imagine so

celest lodge
# mortal robin I should imagine so

I thought it wasn't because the wrong things were being selected, but I found out that was because I had the wrong things enabled first at runtime lol

celest lodge
#

LocalButton is meant to fire a console log when its been selected

#
public void Select()
    {
        EventSystem.current.SetSelectedGameObject(null);
        foreach (var button in GetComponentsInChildren<ButtonUI>())
        {
            button.ResetData();
        }
        EventSystem.current.SetSelectedGameObject(selectable.gameObject);
        Debug.Log("Selected first item: " + EventSystem.current.currentSelectedGameObject, EventSystem.current.currentSelectedGameObject);
    }
mortal robin
#

looks like it's logging?

celest lodge
#

but it is selected when i start the scene

#

so that is weird

#

and when I navigate, it works so i am confused. but there is no visual response

velvet smelt
#

are cursors always 32x32px?

#

confused about hotspots. cause if anything changes cursor size (OS or so), then doesnt the hotspot get offset?

pine crag
#

Hi!
I just updated the editor from 2022.3 to 6000.0 and I'm facing this issue. The development console is now showing like this. Is there a place where I can assign the font/assets used to render the console text? Or what should I do to fix this?
(I'm not really sure if this is the right place to ask about this, but I don't see a better channel, so let me know if I should post this somewhere else.)

low pike
#

TMP materials need updating, should just need to re-import the essentials

#

oh wait.. half read your message... development console, is that Unity's or a custom one?

pine crag
#

Yeah it's the Unity's console. All my UI is actually working fine, is just this console that's not working. But I'm currently debugging the log console rendering like this is making it a little harder haha

low pike
#

Ignore me then.. I haven't used that in years.

#

It wouldn't surprise me if it's just broken in U6 and not intended to be fixed as an out of date/ unused thing with a half-arsed/ no replacement

shrewd minnow
#

Hey all, i need help getting some ideas about implementing a attack range indicator for my character. Basically the range indicator is represented by the beige color bar underneath the character, I want the range indicator to extend or shorten during game play. One Idea i have is to use a progress bar represent the range indicator, however Im not so sure if the end of the range indicator will be kept or will it be chopped off.

supple basalt
#

Sounds like you want a 9-sliced sprite

#

or, in your case, more like a 3-sliced sprite! there will be no top or bottom pixels

#

A 9-sliced sprite keeps its corners sized normally, stretches its edges on one axis, and stretches its center on both axes

shrewd minnow
scarlet jetty
#

Anyone use OneJS with UIToolkit? Is it worth using or does it overcomplicate the UI? I'm a software engineer by day, so OneJS looked interesting to me

shrewd minnow
supple basalt
#

You'd just give the top and bottom parts 0 pixels

#

So it will wind up looking a lot like that, yeah

shrewd minnow
#

thanks! im going to try it now. Glad i didnt try to fiddle around with the progress bar first lol

dense basin
#

Hi, does anybody know how to make the TextMesh Pro text not blurry? I have been trying for an hour and cant get it to look sharp

supple basalt
pine crag
supple basalt
#

But it was a different problem -- all of the text was completely missing

#

no error shader in sight

#

I had to explicitly set GUI.skin.font, I think

bright dagger
#

is there something specific I need to do to enable controller navigation in UI? I'm using the new Input System with Action Maps for Player and UI and a random controller I connected works flawlessly within gameplay but does nothing in a menu

#

ah, seems to me the Event System just needed the correct reference to an Actions Asset!

dense basin
#

Hi I am trying to use the TextMeshPro function isTextOverflowing but it keeps on giving me false when my text is obviously overflowing. Does anybody know why?

bright dagger
shut star
#

hello, why I cant use my Icon in an image?

mild kernel
inner fjord
#

My text is not showing for some reason ...

azure flame
#

See inspector under text input

inner fjord
#

THANK YOU SO MUCH

rocky lion
#

One message removed from a suspended account.

rocky lion
pine crag
shut star
full solstice
#

I want to divide a canvas into two pieces. I tried using a horizontal layout group, but I can't figure out how to get the two pieces to be different sizes. How can I split the screen into two sections with a vertical division between them?

#

Basically, I want one panel to occupy about 15% of the horizontal width of the screen, and I want the other panel to occupy the other 85% of the screen.

#

I think I figured it out by adding a layout element to the green panel and increasing its min width

#

That seems to work

viral depot
#

Is there a way to unpress (or should I say release?) UI button after you click on it? It stays pressed until you click it the second time, and I want to change it

azure flame
#

Clicking sends click event once then releases the button. Make sure you don't have highlighted Color not set to something other then white, it would tint button on mouse over.

supple basalt
#

You may also be seeing the "selected" tint

#

There's an annoying conflict there. If you're navigating a UI exclusively with the mouse, then selection is pointless. But if you're using a keyboard or a controller to navigate, selection is necessary

viral depot
#

Okay, thanks to both of you, I've fixed the issue!

shut star
#

hey, how do you set a max char limit to an input field?

mortal robin
shut star
#

i dont find it

mortal robin
#

Look harder 😊

shut star
#

which object?

mortal robin
#

In the inspector of the TextMeshPro Input Field component

shut star
#

i renamed it thats why i didnt found it -_-

#

thx

candid crow
#

so im trying to put a 2d png with a transparent backround on a quad but everytime i select it as transparent it ends up looking like this does anyone know a work around? i tried it with roughly 4-5 differant images and they all end up looking the same

#

this is what it is so post to look like just without the white

supple basalt
#

This pattern is caused by "dilating" the edge pixels out into the transparent area, so that you don't get weird colors when sampling near the edge at a lower mipmap

#

it expands the color into the transparent areas

#

You shouldn't be able to see that color, though

candid crow
#

yea i figured it out i just needed to change the rendering mode on my material to cut out for some reason

supple basalt
#

Cutout means that any pixel below an alpha threshold gets thrown out entirely

#

what shader are you using here?

candid crow
#

Transparent

supple basalt
#

no, what shader are you using? the thing you pick in the dropdown

thorn tapir
#

does any one here have a solution to the hidpi issue with linux and the editor? its not really usable in unitys current state on linux. i cant read the UI its far too small.

thin creek
#

Hey, i wanna do a pie chart in UI, but i want to have some equitables parts. I just want to make the outlines of the parts, i let u some images for example. I want to have a parameter to change amount of parts

supple basalt
#

oh hey, I did this

#

Each wedge in this radial menu is an Image. I use a shader to compute the area that should be filled in

#

There are no sprites at all

thin creek
#

But this system could not work with a radial 360 pie chart

#

i mean, u "deform" ur sprite with ur shader ? if u have no sprite

supple basalt
#

There is no sprite. The shader just figures out which parts should be opaque and which parts shouldn't be

thin creek
#

oh okay, i see, and how did u do that shader ?

supple basalt
thin creek
#

oh big thanks i'm gonna check ty

supple basalt
#

The gist is that it figures out the angle and radius of the pixel

#

Then it decides if that's "in bounds" for that wedge

#

Note that this means I have one graphic for each wedge

#

I might rewrite it so that I only need one graphic

#

(that'd just make it harder to put images and text on each wedge)

supple basalt
#

It would be a similar idea, though

#

The shader figures out an angle and a radius

#

It uses that to decide whether to be filled in, empty, black (for the lines), or transparent (outside of the circle)

thin creek
#

this shader is way too much complicated as i'm beginner lmao

#

i don't really know how to try on scene view ur shader

#

because i'm on URP

supple basalt
#

maybe start out with a UI shader that just shows you an angle

#

The shader graph has a node to turn a position into an angle and a radius

#

"Polar Coordinates"

#

Also, what version of Unity are you using? I should make sure you can actually do UI shader graphs first...

thin creek
#

I'm on unity 6

supple basalt
#

okay, that should be good

thin creek
#

6000.0.30f1 to be exact

#

I don't really know how to create a UI shader

#

Oh, is it "sprite unlit shader graph" ?

supple basalt
#

ah, you want "Canvas Shader Graph"

thin creek
#

kinda, it's a sprite on my UI

#

oh i saw on builtin

#

mb

supple basalt
#

unless it's actually a Sprite Renderer, that'd be the wrong kind of graph

#

Image components also use sprites

#

but they're rendered very differently

thin creek
#

it's a image component on canvas yeah

#

so it's not canvas i guess

#

I don't really know how to just show an angle lmao

supple basalt
#

If you have no idea how to create shaders, I'd suggest starting here

thin creek
#

I know how to create some shader, but not in UI

#

I just saw that canvas SG can be used for image rendering

supple basalt
#

The process is pretty similar, then

#

Plug UV0 into the Polar Coordinates node and you'll get an angle + radius

#

You'll want to subtract 0.5 to center the circle

thin creek
#

UV0 from screen position node ?

#

or UV?

#

Like this, i subtracted 0.5 to get center, but i guess it's not ok?

#

oh with center of 0 and 0 i have something

supple basalt
#

Yeah, that's the idea

#

I forgot that you can just set the center

#

The output contains the angle and radius (or was it the radius and angle?)

#

Try using other math nodes to manipulate these values

#

e.g. multiply the angle by 10 and then output white if that value modulo 1 is less than 0.2

thin creek
#

So u mean i have to split the output

#

yeah i guess it's correct

#

I made this for now

supple basalt
#

Multiply by a large number and then take it modulo 1

thin creek
#

the angle ?

#

or the radius

#

But modulo 1 is always 0 btw

#

or maybe i forgot some math techniques from school

supple basalt
#

The angle.

supple basalt
thin creek
#

oh ok

#

But it's always integer wherever i'm using even with nodes

#

i'm really not intelligent tonight lmao

#

i'm still completely lost lmao, i don't really know what to do with both of angle or radius

supple basalt
#

If you want to make a repeating pattern, you need to do something based on the angle

supple basalt
#

just plug it together and see what you get

thin creek
#

wait, u want to plug the angle on a node modulo, and set B input at 1?

#

oh lmao i didn't get this

#

oh my god

supple basalt
#

perhaps a smaller number!

#

you may wind to divide by pi, too

#

you can just type in, say

#

20 / pi

#

and it'll compute the right number

thin creek
#

on the multiply by angle?

supple basalt
#

Right.

#

If the angle ranges from -pi to pi, then dividing by pi will remap it so that it ranges from -1 to 1

thin creek
#

oh i got some circular things

#

that's crazy

#

But with this now, it does just some visual illusion

#

lmao

#

Should I use now the radius to represent the pie ?

supple basalt
#

You're using the radius instead of the angle

#

Wrong direction!

supple basalt
# thin creek

I was wondering why you got that crazy moire pattern

thin creek
#

oh so it's not the good thing? lmao

#

wait

#

oh yeah

#

so i have a beginning of parts i guess

supple basalt
#

oh right, and this isn't actually "modulo"

#

it's the remainder operator

#

notice how the pattern stops when the input goes negative

#

grumble grumble

thin creek
#

...mh i don't see the operator that i could put instead

supple basalt
#

You can add pi to the angle before you multiply it

thin creek
#

aw

#

wait

#

oh yeah, to have a full circle

supple basalt
#

Otherwise you'd have to do your own modulo node

thin creek
#

yeah i'm gonna add pi šŸ˜‚

#

😮

supple basalt
#

now you can do something like

thin creek
#

That's so amazing

supple basalt
#

distance(val, 0.5) < 0.1

#

and you'll get wedge-shaped lines

thin creek
#

oh yeah, instead of smooth from white to black

#

How to do the "< 0.1" ?, i have done the distance of output from modulo and 0.5

#

that just gives me much black lines

#

i put step node, but that's not lines, it's like triangles

supple basalt
#

To get a line of fixed width, you'd need to vary that "Edge" value on Step

#

Try dividing 1 by the radius and plugging that in

thin creek
#

oh

supple basalt
#

This will halve the angle every time the radius doubles

thin creek
#

u mean this?

#

because it's kinda... white

supple basalt
#

you multiplied the radius by 0.2

#

that will cause 1 / radius to be 5 times larger

thin creek
#

oh ok so i take off the 0.2multiply

#

it does something

#

like it's not completely white actually, but the output is.. weird

supple basalt
#

now adjust the values

#

divide a different number by the radius

#

see how the output changes

#

mess with it!

thin creek
#

That's awesome

#

that's not completely perfect, but it's really better

supple basalt
#

There you go

#

So that's the angle part

#

You'll also want to use the radius to decide where to draw lines

#

e.g. always fill in very close to the center, and stop drawing them past a certain radius

#

That's basically what my shader graph does

#

It decides if it's "in bounds" based on both angle and radius

#

If it's close to the edge, it draws a black pixel; otherwise, it draws a gray pixel

#

and if it's out of bounds it draws nothing

thin creek
#

U guess that i have to do the same shader that u gave me before ? lmao

#

i'm' gonna die

#

it was too much complicated

supple basalt
#

you've already got half of it, really :p

thin creek
#

Except that when i create a material, and put it to my image

#

before, i had something, now i have nothing lmao

#

i'm too fckg dumb

#

I thought it was connected to base color

#

there we go

#

So to have straight lines, i have to add what ?

supple basalt
#

oh, I just realized step is the wrong function

#

you want to compare the value coming from "Distance" to the value coming out of "Divide"

#

if it's less, you draw the line

thin creek
#

huh

#

u lost me

#

So distance has to be plug with the divide result

#

not on step node, but on another one ?

loud wagon
#

Trying to use a content size fitter in my layout group for these images. That works just fine, but, unfortunately, I have to rotate this gun sprite 90 degrees, as it is imported at that straight up and down angle for other unrelated reasons. When sprites are rotated 90 degrees, the content fitter is unaware of this, and applies the height to the fitter as if it were not rotated, causing that big gap between the text and image.

It's a long shot that there is a fix, but I wanted to ask just in case.

supple basalt
thin creek
#

huh comparison ???

supple basalt
#

yes. to compare two values.

thin creek
#

yeah but the output

#

goes where?

supple basalt
#

try plugging it into the color output (:

thin creek
#

fr ?

#

wait

#

i didn't know i could do that

supple basalt
#

your computer won't explode if you plug the wrong thing in

thin creek
#

yeah i know lmao

supple basalt
#

I haven't thought about rotating UI elements much

thin creek
#

oh i have this now

supple basalt
#

show the entire shader graph

thin creek
#

wait i'm gonna compact it

#

huh the screen is not really clear

loud wagon
supple basalt
# thin creek

you're subtracting one coordinate from 0.5 and subtracting 0.5 from the other, by the way. that seems a bit odd

#

just set the "Center" on the polar coordinates node to [0.5, 0.5] and get rid of those two subtractions

#

Also, you aren't using the radius at all

thin creek
#

yeah that's why i'm confused

supple basalt
#

The radius is supposed to be plugged into Divide

#

not just a constant 2.02 or whatever

thin creek
#

I did, but it does something weird

#

but that was modulo, wait

supple basalt
#

try increasing or decreasing it

supple basalt
thin creek
#

oh my godness

#

U are the best i swear

supple basalt
#

I'm not sure how you'd query that from the Image component...

thin creek
supple basalt
#

but you'd just want to switch the width and height values

#

there it goes!

thin creek
#

wawww it's beautiful

#

i love it

supple basalt
#

By varying the number you multiply the angle by, you can change the number of segments

#

And by varying the number you divide by the radius, you'll change the thickness

thin creek
#

yeah i already tried

#

but how can this match my "circle" sprite ?

supple basalt
#

Now you just need to write a similar graph for the radius.

thin creek
supple basalt
#

it'll be simpler though

#

If the radius is too big, draw a transparent pixel

thin creek
#

u mean for the alpha ?

supple basalt
#

Right

thin creek
#

ooh

#

that's why it's black background i see

#

great thanks

loud wagon
supple basalt
#

well, hang on a tic...

#

You've got the content size fitter on the image itself

#

I'd expect that to be on a parent object that has a layout group

#

something like...

loud wagon
#

Yeah, I just removed it.

supple basalt
#

Ah, I see

loud wagon
#

It's also not the source of the issue, which would have been easy, lol.

supple basalt
#
  • Content <-- ContentSizeFitter, VerticalLayoutGroup
    • Image <-- LayoutElement
    • Text
    • blah blah text
#

If you ever see this warning, you're doing something wrong, btw

loud wagon
#

That's not necessarily true, as even the unity documentation laughs at that warning given it's how groups of fitters are used for flexible layouts. But in this case the fitter was not doing anything.

supple basalt
#

where is that?

loud wagon
#

When you're nesting content fitters in layouts with content fitters, the warning is not legitimate. I use it all the time for panels of panels that are flexible.

#

There are superior implementations other than vanilla Unity. However it's all custom code.

thin creek
supple basalt
#

if you have one, then your parent is responsible for resizing you

#

Slamming ContentSizeFitters into places they don't belong sometimes works, and then sometimes it gives you weird results

supple basalt
thin creek
#

Yeah but with a comparison like this, it's not really a circle, it's an ellipse, and i didn't understand for the transparency btw

#

Forgot about the size

supple basalt
#

that'll do it!

#

the radius and angle come from the UV coordinate, not from a position in the world or anything

#

so squishing the image will also squish the circle

thin creek
#

Yeah, so it's a circle, but i want transparency on the background

#

to have an image behind

#

And also, if i do 3 parts, the line is wider than 12 for example

supple basalt
#

Yeah -- you might want to factor in the number of segments when calculating that angle limit

#

The (modified) angle is changing more rapidly when you have more segments

#

So the lines get thinner

thin creek
#

yep, i should do some calculations on script, it's ok

supple basalt
#

that can be done in-shader

thin creek
#

really?

#

But actually, my circle is made by this

#

And the float that divides angle, if i change, it changes the size of the circle lmao

supple basalt
thin creek
#

okay okay

#

oh it works actually, i made it from the polar coordinates nodes, and i have a circle x)

#

i made alpha by myself

#

let's go

rain flare
#

The message is visible in the Scene but not in the Game

shut star
#

why in the ui builder I do have the placeholder but not in game?

silent condor
#

for some reason only on this page this button does not want to work

#

using UnityEngine;
using UnityEngine.SceneManagement;

public class NextLevel : MonoBehaviour
{
public void goToScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}

#

this is the script i used and when i'm in game it does not change the scene

#

does anyone have an idea on how i could fix this?

silent condor
#

i just copied the other scene and it just works lol

supple basalt
#

The buton may have been blocked by another UI element

mortal robin
merry scarab
#

Im trying to access Fill Amount, from the Image class

#

but there is no such thing

merry scarab
#

Thats 2019 documentation

#

in Unity 6 is not there

sage anchor
#

Oh in Unity 6 ic

silent shale
#

For some reason when i'm trying to work with user interface and vertical allignment I met this problem where the items are having a huge space apart from each other

#

The green line is the size of the panel

#

this is the size of the text

silent shale
#

this is the setting of my vertical layout group

#

I set it to middle center but it is not in the middle for some reason

#

but somewhere in the middle of middle and lower

sage anchor
merry scarab
#

Ahh, ill take a look thank you

sage anchor
merry scarab
#

Ok, IntelliJ was messing with me

#

found it

#

tyy for helping me

sage anchor
#

np

sage anchor
#

I mean the rect transform component on your textmesh ui object

silent shale
#

how do I see the rect transform component though

#

owhh nvm found it

#

and this is for my text

#

I have three objects inside the vertical allignment

#

but for some reason due to the padding that goes too far

#

it have overflowed and went below

sage anchor
#

Uncheck child force expand height and check use child size height

supple basalt
#

yeah -- the default layout group settings are very funny

silent shale
#

Thank you so much

#

What is the reason behind that though?

sage anchor
supple basalt
#

Force Expand means that children are given left-over space even if they didn't ask for it

#

This can kind of make broken UI setups work

#

But it falls apart very quickly

silent shale
supple basalt
#

The rule of thumb is that every object with children should have a layout group on it that controls the size its children.

#

well, every object with children of varying size

silent shale
#

I'm not sure whether this should be posted in this section or not but I have a problem with the colider

#

It gives me this error

#

BoxCollider does not support negative scale or size.
The effective box size has been forced positive and is likely to give unexpected collision geometry.
If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path "Environment/Interactable/Destroyable/Destroyable To Room Set Box/Warehouse Crates (7)/Box 1"

#

and based on the object

#

There is nothing that have a negative value or so

silent shale
#

yeah the parent's z axis is being scaled at -1

#

and when I try to scale it back to 1

#

the x and y became -1

#

🄲

summer basin
#

from imGUI to uGUI and now UI-toolkit, personally I still prefer uGUI "but" it could surely be improve like the NovaUI package.

red hawk
#

How can I set the image correctly? It always showing the first slice. Is this a bad practice to group them?

atomic fox
#

Is there a way to show children of a viewport outside of a viewport?
I have a scrollable list inside a viewport for equipment from which the player can drag their equipment onto equipment slots. However, since the equipment is inside the viewport, it is hidden while dragging. See video for explanation

#

I could instantiate a GO on click and drag that, so the draggable object is always outside of the viewport, but it doesn't feel like the most straightforward solution

mortal robin
#

But often for click and drag stuff I cheat and use Graphics.DraeTexture or something

atomic fox
#

I'll look into DrawTexture later on, thanks for the tip

rapid ferry
#

Ui ux dream is nightmare for dev

mortal robin
atomic fox
#

Yeah, I remember from working with Shaders.
I just read that Sprites can be rendered outside of the Mask since they're not UI based, so I might try that if it's not too bad performance-wise. I've got a couple of things to test now, will do that when I have time next week!

grizzled inlet
#

Hey guys! How do you do a similar thing in a 3d game?

#

I've got this for some reason.

mortal robin
mortal robin
#

Yes?

grizzled inlet
# mortal robin Yes?

Bro Why is it that when I rotate the shelving unit 180 degrees so that it faces me with the shelves, the price UI is dumbed down

serene tusk
#

What properties are these? (Left, Right, Top, Bottom)

mortal robin
#

They are Left Right Top Bottom šŸ¤”

serene tusk
#

There's no RectTransform.Left property for example

mortal robin
serene tusk
#

How do I modify them in script?

lofty pasture
#

Am I correct in assuming that for something like headplates, the best approach is still to place them all in a single screenspace canvas and update their positions on a frame-by-frame basis?

That's how I'm implementing them in UITK currently but looking to migrate to UGUI (or Unity UI as it's calling itself these days) and vaguely recall canvases being quite expensive to spin up

upper wigeon
#

Im making a mobile game and my sprites look pixelated at 16:9 aspect ratio, and even worse at 2K resolutions. What could be the reason? I would like to have hd and sharp sprites like many well known mobile games. Also in the case of the UI and its animations the PPU doesn't affect, since I adjusted the images using the rectransform component, could this be the problem?

mortal robin
lofty pasture
mortal robin
#

Not that I know a better way off the top of my head but I had an issue with a similar approach once

lofty pasture
#

I'm seeing OK performance with the position updating approach on UITK, I'm more wondering if worldspace canvases still perform like trash once you have more than 3 or 4 on screen at once.

mortal robin
#

Ah yeah sorry my example was in UGUI

#

No experience with such things in UITK

upper wigeon
upper wigeon
#

In my first message I said they look bad in 16:9, although that was just the profile picture sprite which I think was too small (in PS I scaled it to 1024x1024) and now in the aspect ratios it looks good, but not in the fixed resolutions.

#

Perhaps it is the PPU or the size of the rectTransform of each image that lowers the resolution when scaled down.

grizzled inlet
#

hi guys

#

What is the correct way to do it, first create an empty object and then canvas in it?

#

and also a different canvas for each panel?

grizzled inlet
mortal robin
grizzled inlet
#

Learn how to make a main menu using Unity!

ā— https://www.assetstore.unity3d.com/#!/content/84126?aid=1101lPGj
ā— Developer Forum: http://forum.brackeys.com/

ā¤ļø Donate: https://www.paypal.com/donate/?hosted_button_id=VCMM2PLRRX8GU

Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·

ā–ŗ Join Discord: https://disco...

ā–¶ Play video
#

In such and similar videos I did not find the answer to my question!

sharp belfry
#

How to do a layout group where one element takes up 75% of the space and a second takes up the remaining 25%? You can 'use scale' and set one scale to 3, but that makes all the elements have stretched scales as well.

tribal latch
supple basalt
#

Just give the two RectTransforms custom anchors

#

Normally, the min and max anchors are either together (thus, no stretching) or at 0 and 1 (to fully stretch)

#

but you can pick some intermediate value

vapid edge
#

Making a scrollrect that would snap to its elements, kinda like a scrolling date picker wouldn't be very trivial, would it

#

thinking of recreating something like this using a scrollrect

split finch
#

hey guys, I am having a problem where tags don't exactly work in text mesh pro

azure flame
#

You need to illustrate the problem and explain what do you mean for someone to answer

split finch
split finch
#

I clearly have the Override Tags option enabled, but its still not working

#

I've even tried the fonts supplied with TMP

azure flame
#

override option is to override rich text tags

split finch
#

isn't the <color> tag a rich text tag?

azure flame
#

it does the opposite of what you want it to do

azure flame
#

or warnings

split finch
#

I've even tried other colors, and even hex codes

azure flame
#

make sure override option is off, did you type those quotes yourself?

split finch
#

yes I wrote those qoutes my self

#

oh sorry

azure flame
#

override tells it to ignore rich text tags

split finch
#

I thought override tags should be on not off

#

sorry for the confussion

#

thanks for the help

#

someone should really update the docs

#

they're really confusing tbh

grizzled inlet
#

guys, How to fix that the text does not go beyond the border?

grizzled inlet
sharp belfry
grizzled inlet
sharp belfry
#

lol I'm stupid. Same font I'm using, but it looked different because glow

azure flame
grizzled inlet
azure flame
grizzled inlet
sharp belfry
#

What's the layout group even for?

#

Why not get rid of it and anchor to the right

grizzled inlet
supple basalt
#

specifically, put the pivot point at X=1, Y=0.5

#

This will cause it to grow to the left (since its origin will be on its right)

native basin
#

Guys, hello! I need help. I'm trying to use a world-space canvas on top of a screen-space overlay canvas. However, I've realized that the overlay canvas is on top of everything, so my UI won't show up. When I try to change the overlay canvas, the camera only shows a black screen. Also, I'm using a render texture on the main camera. Does anyone know what to do?

#

:[ you see the pathetic bag?

#

thats supposed to be an ui element, i dunno what to do

mortal robin
native basin
mortal robin
restive gale
#

why is the text mesh pro outline color literally never shows correctly? I have to change it in order to fix, but then seconds later it changes again on the game or in the editor preview

#

I change to the same color just to re-apply the correct one, press ctrl+s to save and the color changes back to a brighter version

restive gale
#

And just like he said "Can’t believe we have to do this ourselves for such an old bug, thanks Unity…"

proud sandal
restive gale
#

It still happens unfortunately, even forcing to use gamma color :(

proud sandal
#

I find your particular color deviation to be a bit extreme relative to what a gamma issue would cause. It’s not a camera or world space canvas or non-ui TMP component, subject to post processing, right?

restive gale
#

I agree with you, but I believe the issue resides with TMP because it happens even on a brand new project. The little tool to 'convert' the color to use in TMP just subtracts the color in power to make it darker, and it works, so I believe to some extent it is a gamma issue lol

proud sandal
restive gale
#

It is in the mobile shader, which is not HDR

#

but I do remember this behavior on the normal shader as well

somber sundial
#

Dose anyone know, why my buttons just became invisible?

low pike
somber sundial
#

Do you need the inspector and hierarchy details? @low pike

low pike
#

that would be a good start..

vivid berry
#

hi, i got a problem with ui animation. I made an animation on button on highlight but i doesnt work. Only pressed animation work.
Image
tried somethings found on internet but nothing worked. Tried disabeling some of the objects but nothing

mortal robin
#

The only thing the button component does here is set triggers in your animator

vivid berry
mortal robin
#

with the right conditions

#

(are the triggers set up properly?)

vivid berry
#

umm, i dont think so? i've seen now that if i have click pressed and hover over button it gets highlighted

mortal robin
vivid berry
#

i tried setting them like this

mortal robin
#

you need to open the Parameters tab in the Animator window

#

make sure you have set up triggers with the names you are using on your button component

#

And then have transitions in your state machine (the transitions are the arrows) use those triggers as the condition

vast bay
#

hey i'm making a textmeshpro button
how do i round the corners of the box more?
-# please ping once you reply

mortal robin
#

Or use spriteshape to create one

vast bay
mortal robin
#

There's nothing automatic about it. You are using a sprite image with rounded corners

vast bay
#

Oh, okay, thanks.

sharp belfry
#

Every time I try to make a layout group of other layout groups (for example a horizontal layout group where the children are vertical layout groups) the parent layout gets all messed up - the children layouts seem to override it. So the children elements will be different widths and/or the total width will exceed the parent group, etc

#

Anyone know why this happens

low pike
vast bay
vivid berry
somber sundial
low pike
#

zero need to reply and ping me with that..

somber sundial
somber sundial
rapid ferry
#

I was wondering if anyone could help me with this image problem I have been having in multiple projects of mine? where even though the image is way bigger than the canvas it still shows partially what the camera sees (The yellow)

mortal robin
rapid ferry
#

ooh sorry its supposed to be a fully black screen but part of the camera for some reason peaks through even though the image is way way bigger than the canvas

mortal robin
#

can you show the canvas/image setup?

rapid ferry
#

Yea it was just a test unity project to try to fix the problem so there is not much

supple basalt
#

good! that makes it easier to diagnose the problem

rapid ferry
#

Here is the canvas

#

idk if you need this but here is the image to

#

this is the inspector

#

do you need anything else?

supple basalt
#

instead of scaling the image up a bunch, just set it to stretch on both axes and then give it top/bottom/left/right values of zero

#

like this

#

(although, I wouldn't expect a scaled-up image to have the problem you're seeing)

heavy sentinel
violet sandal
#

someone played our game today on twitch and i saw a weird flickering in the UI which i never saw when playing myself.
Does someone know what can cause this?
https://www.twitch.tv/videos/2343105147
At Time 4:31:10

heavy sentinel
# violet sandal someone played our game today on twitch and i saw a weird flickering in the UI w...

Looks like a floating point precision error. Such flickering could happen if the center of the pixel has 2 values next to each other. Imagine that you have a pixel, but you try to display one color on the left side, and another color on the right side - it's unclear what color should be use, since both values are next to the pixel's center. Technically, moving the UI element by 0.001 px to the left or to the right would solve the problem, as the edge would no longer be in the middle.

For testing purposes, I would suggest figuring out what resolution was used on that stream, then test the game on the exact same resolution. Keep in mind that fixing it on one resolution might break it on a different one. But as the shape of UI more or less overlaps with the shape of area covered by pixels, it should look good.

violet sandal
heavy sentinel
sharp belfry
#

Is there any easy way to flip an Image? For a sprite there's a flipX flipY, but not for image and it's annoying. Only thing I can figure out is rotating by 180, but that screws up all the children and/or layout groups.

#

for example I have this and if I want to use it in 4 different directions..

serene mauve
mortal robin
sharp belfry
#

seems like there's nothing better

#

I wonder why flipX flipY isn't a thing for images

mortal robin
#

You could write a really simple UI shader to do that

#

And by "write" I mean "make one in shader graph"

sharp belfry
#

Oh, hmm

#

shaders were the most difficult part of the whole process on my last project, so I've been avoiding them

small phoenix
#

idk if this suits ui or mobile mor

#

but i am wondering is it possible to simulate onkeypresses with ui button

#

cause as im aware ui button does not detect how long you hold it and i have a character that has a longer jump when you hold