#๐Ÿงฐโ”ƒui-toolkit

1 messages ยท Page 13 of 1

gusty estuary
#

all elements that should be possible to select via controller need to be focusable

#

for buttons you either use built in Button and subscribe callbacks via clicked event

#

or there's a more complicated way, but I guess you don't really need to know about it atm

spark axle
#

would you recommend making an entire game using UI toolkit or canvas instead?

#

I like the styling UI toolkkit offers, but it seems more tedious when it comes down to scripting?

rough scarab
spark axle
#

missed this very useful page, thank you ๐Ÿ‘

#

but I guess it is recommended there since I'm in for "Multi-resolution menus and HUD in intensive UI projects"

#

I'm mostly confused by how scripting structure works with UI toolkit

#

with uGUI, you'd be instantiating parts of the UI via prefabs with components managing their own controls

#

but with UI toolkit, the best I can understand so far, would be a single UI Document object with multiple components, each managing wide parts of the UI?

#

since there's no aparent way to attach a script to a visual element?

rough scarab
#

Sounds about right

wispy sage
wispy sage
gusty estuary
#

there's also a way to attach scripts if you go with route of letting Unity instantiate assets

#

this way you just GetComponent<UIDocument> and that's what you apply your scripts on

#

(I wouldn't recommend this way though, it provides very little control)

gusty estuary
#

@gusty vapor did you know it's a thing in lts?

gusty vapor
#

yes Image can do vector graphic since ages ago

gusty estuary
#

it's background style

gusty vapor
#

OH! I did not know that

#

so they made it glocbal now... oh neat

gusty estuary
#

I don't get what type it uses though

gusty vapor
#

I'm guessing they also copied the ScaleMode of Image class now too

gusty estuary
#

Vector Image

gusty estuary
#

well

#

Can your lib export one?

#

as asset

gusty vapor
gusty estuary
#

poggie woggie?

gusty vapor
#

or UIToolkit format type.. I forgot what it's called

gusty estuary
#

got any svg at hand?

gusty vapor
#

brah.. google will give you mmillions of SVGs ๐Ÿ˜…

#

try get one from there

gusty estuary
#

nah

#

not imported

#

just says "Default Asset"

gusty vapor
#

ah too bad...

#

then it's just for VectorImage then

gusty vapor
#

try it

gusty estuary
#

not in a mood for it atm

gusty vapor
#

yeah, too bad they require us to still install another package for that

small wigeon
#

I was digging into that before, it's called Background and it doesn't look like you can use it in your own stuff ๐Ÿ˜ฆ

gusty vapor
#

pretty sure it would work if you install the vector graphic package

#

and I'm expecting it's working out of the box with vector api

#

by that I mean VectorImage specifically

acoustic trout
#

Hi, I am looking to use the new Unity input system with the Ui toolkit. I want to use controllers as well as keyboard and mouse. I can't seem to find any documentaiton on moving to the next element or whatever . Please throw links my way . Videos, blogs, docs anything

gusty estuary
#

controllers trigger Navigation events which modify focus

gusty vapor
#

if only DropdownField can do datapair and not just string kekwait

#

time to roll my own I guess ๐Ÿ˜ญ

#

KeyValuePair<TKey,TValue> seems nice on ``DropDownFields`

gusty estuary
gusty vapor
#

by bloats I mean, reducing the amount of iterations

gusty estuary
#

you want keyvalue pair and you want to avoid indirect binding ๐Ÿค”

gusty vapor
#

we can do delegate as value in keypair

gusty estuary
#

๐Ÿค”

#

you can just write a wrapper for dropdown field which will accept keyvalue pair list

gusty vapor
#

depends on your vs my definition of bloats here ๐Ÿ˜†

gusty estuary
#

and feed strings to element itself

gusty vapor
#

looking for a re-usable solution, this is for public apis for my work stuffs

#

so itmust be done nicely

gusty estuary
#

I'd do it with wrapper then

#

new DropDownFieldWrapper(dropdownElement, keyValuePairs);

#

and maybe some action callback

#

for selection

gusty vapor
#

yes something like that, exactly...
Fun fact tho, lots of editor apis in uitk use that workflow... but NOT dropdownfield

wise ravine
#

Hello,

I'm a beginner on Unity and as part of a unity project, I'm creating the interface with ui-toolkit. However, I'd like my interface to work with a joystick and I can't figure out how to do it.

Is it possible to do this, and if so, how?

Thanks in advance for your answers.

unborn bluff
#

What is the selector to change the style of a dropdown's list

gusty vapor
#

in 2021 and some 2022s, this is not possible due to the dropDownMenu s aren't derived frommm VisualElement

#

you should check if it's possible inn 2022 lts and above

#

they said, they're considering to add the generic version of it, which is derived from VisualElement

#

making a custom one isn't that hard at all, this is my ancient proto based on ancient version of uitk

#

absolute position is your bff for this use case

gusty vapor
unborn bluff
#

Thank you. Can't believe smth so simple turned ot to be so complicated ๐Ÿ˜…

unborn bluff
#

@gusty vapor I actually managed to change it by adding my USS to the Style Sheets list of the Unity default runtime theme

gusty vapor
#

nice! ๐Ÿ‘

gusty vapor
#

not too shabby blushie

#

right after I said it ๐Ÿคฃ

acoustic trout
#

So I managed to get this far. I have the console outputting when the directional buttons or keyboard has been used , so I guess my question is, Upon onNavMoveEvent do I cahnge the foucus to one of the 4 buttons in my UI?

#

with something like , button.focus()

wary swan
dire nova
#

I've got this exact issue: https://forum.unity.com/threads/textfield-not-responding-to-input-run-time.863920/

I cant figure this part out: "If I change the Panels Event System's "Event Generation" from "Read input" to "IMGUI Events" then I can move the caret left/right and I can delete characters using the backspace and delete button. I cannot type new text, but I can copy/paste."

Where can I change/select the "event generation"?

wary swan
dire nova
gusty vapor
#

why Clear is much expensive and slower than re-instantiating the whole hierarchy.. I don't get uitk sometimes kekwait

gusty vapor
#

@gusty estuary is SetEnabled doesn't cancel all the events on children?

gusty estuary
#

it's not disabling element btw

#

so gotta keep it in mind

gusty vapor
#

apparently it's a confirmed bug..fixed in 2023

gusty estuary
#

what is?

gusty vapor
#

SetEnabled should cancel event propagations

gusty estuary
#

no idea on that

gusty vapor
#

SetEnabled(false) I mean

#

I mean it's only logical to cancel all events during disabled state

gusty estuary
#

why

#

it's not working same as display style

gusty vapor
gusty estuary
#

I wouldn't want to stop propagation

#

kekw

#

well

#

whatever you are trying to accomplish

#

is not meant

#

so just stop

gusty vapor
#

there's a way.. upgrade to 2023 ๐Ÿ˜„

#

I'm stuck on 2021 at the moment

#

crazy

gusty estuary
#

well

#

newer version will probably improve performance too

#

anyway

#

disabling + opacity is same thing as display but with extra steps

#

so I'm pretty sure it'll be even worse performance wise

#

besides

#

it's not going to adjust layout

#

you'll just get invisible spot

#

kekw

gusty vapor
gusty estuary
#

kekw

#

that's probably 2021 thing

#

allthough

#

wouldn't bet on that

gusty vapor
#

you should avoid that

gusty estuary
#

well, that's what I meant

#

it won't affect layout

gusty vapor
#

imagine.. 1 parent 20 child... flex it, then BOOOMMM... all wasted

gusty estuary
#

test it on 2022+

#

Pretty sure it was improved

#

heck

#

this comment is from almost 3 years ago

gusty vapor
#

usually things stay the same for years in Unity ๐Ÿ˜ƒ

gusty estuary
#

"We are currently looking" doesn't ring a bell? ๐Ÿค”

still lantern
#

Hey @gusty estuary is it you that made a MVVM UITK package? Bustedbunny? Looks neat!

still lantern
# gusty vapor

I think I just saw something in one of the newest 2023.2 changelogs about that...

gusty vapor
#

Oh i misread.. ithought it was about the SetEnabled one ๐Ÿ˜„

still lantern
#

Oh, was just reading the 2023.2.0a18 changelog. I wonder if tis is like the runtime binding...?

gusty vapor
#

yes they added runtime binding in 2023, which breaks @gusty estuary 's heart with hiis Mvvm toolkit ๐Ÿฅน

still lantern
#

Oooh, I literally was just looking yesterday at different runtime options!

gusty estuary
#

one less repo to manage

#

kekw

still lantern
gusty vapor
#

to answer to that, I honestly don't know blushie

still lantern
#

All good, I will just look at the source code while I download it ๐Ÿ˜›

#

Woooh, they added UxmlSerializedData so you can now serialize ViewData!? ๐Ÿ˜ฒ

gusty vapor
#

oh shoot, that's the old editor guideline isn't it?

#

they just updated the content I think kekwait

dire nova
#

I'm trying to make some movable windows and they work fine, but if I move to fast the pointer gets outside the window so it stops moving.
How could I prevent this?

gusty vapor
#

I had similar issue, usually this bcos of how too small your rect is for the visualElement
What I did is that I made a invisible parent that's big enough or atleast twice the size of the child

#

also, I did notice that on build, it was rarely happened even without the trick I mentioned above

#

by that I mean, it's not as clumsy on build like you're experiencing in edit mode

cold urchin
#

why can't I use binding path for get set properties?

static canyon
small wigeon
#

runtime binding? ๐Ÿ‘€

#

are there docs on it somewhere?

still lantern
# small wigeon are there docs on it somewhere?

I was just lookin in to it, there are docs, but as far as I can tell they are just auto generated ones from the doc comments on the code.
I just asked here about it. I will update the thread if I don't get a response and end up diving in to the code
https://forum.unity.com/threads/how-do-you-use-new-uitoolkit-binding-system.1446748/

A couple of relevant docs if ya wanna take a look
https://docs.unity3d.com/2023.2/Documentation/ScriptReference/UIElements.VisualElement-dataSourcePath.html
https://docs.unity3d.com/2023.2/Documentation/ScriptReference/UIElements.DataBinding.html

small wigeon
still lantern
small wigeon
#

it's not a package, it's internal

still lantern
small wigeon
#

(I mean, I'm pretty sure it was a package, but I was thinking it was dumped)

still lantern
#

Nah, it was moved to being a built-in package

gusty vapor
still lantern
small wigeon
#

hmmm I don't see how you go from an object to the property stuff

still lantern
#

What do you mean?

gusty estuary
#

what's the purpose of that property package?

still lantern
gusty estuary
#

any use case?

still lantern
#

Binding UI at runtime ๐Ÿ˜›

gusty estuary
#

uuugh

small wigeon
#

I think it's if (PropertyBag.TryGetPropertyBagForValue(myObject, out var propertyBag)) { }

#

basically it's a runtime SerialisedObject

still lantern
gusty estuary
#

honestly struggling to see any value

gusty vapor
#

why? it's optimized ootb

small wigeon
#

well serialised object is editor only

#

I guess this is native reflection?

gusty estuary
small wigeon
#

I think these docs are broken

#

they don't look like they generated properly

#

well binding uses a property on an object, when you create a binding you can create the property accessor thingy without having the object

#

(I'm guessing they can't use C# reflection directly because native stuff needs to use it outside of dotnet?)

#

and it looks like VisualElement has a root data source and path, and a list of bindings

#

and somehow you create a BindingId for the attribute/element on VisualElement

still lantern
#

This binding system is funky as all get out... To set the binding you have to specify the property in the Field you want to bind to. I guess that makes sense for doing more advanced stuff. But feels weird as all get out

#

And it doesn't work with C# Properties it seems...

small wigeon
#

it might be possible that the attributes don't map 1:1 to C# properties

#

I'm sure most of that stuff will be set up automatically when loading the visual asset

#

or deserialising it? is the runtime asset already deserialised?

gusty estuary
#

jeez

#

maybe my framework is not obsolete after all

#

๐Ÿ˜…

small wigeon
#

well I assume theirs will have editor support

gusty estuary
#

I am curious what's faster

#

delegate binding

#

or their binding

#

I guess it's on alpha only atm?

small wigeon
#

looks like it

#

though you could try using Unity.Properties now ๐Ÿ˜›

gusty estuary
small wigeon
#

not the package, the internal module

gusty estuary
#

๐Ÿค”

small wigeon
#

(but that's why I thought it was dead)

still lantern
gusty estuary
#

huh?

still lantern
gusty estuary
#

I plan to use runtime binding of Unity

#

along with all other goodies

still lantern
#

Yeah, I also like to use the Unity native stuff. What I mean is that you would still want a view model, to setup VIsuelElements and what not. Imo at least.

gusty estuary
#

yeah, view model is pretty much a must when using dots

#

ViewModel does not setup view btw

#

it's only providing API for view to bind to

#

(in MVVM)

#

only View knows ViewModel. ViewModel never knows View

still lantern
#

Err, right

dire nova
#

Does unity provide these kinds of default cursors anywhere?

gusty vapor
#

there are two of those, they called Resizable element and Resizer but sadly, both are in Experimental graphView api

#

and Editor only

#

You can steal the impl by peeking at the source code tho

gusty vapor
#

O you mean the icon n not the funtionality haha my bad

dire nova
small wigeon
#

is there an easy way to make the uibuilder display a larger screen-like default size?

#

Also FYI the updated megacity demo uses UI Toolkit

#

and they broke the UI up into multiple documents... I've been lied to!

gusty estuary
small wigeon
#

ah I just mustn't have looked at any new ones ๐Ÿ˜›

gusty vapor
#

@gusty estuary funfact,inlinesStyle cosume lots of memory compared to uss/uxml kekwait

gusty estuary
#

that is mentioned in manual

gusty vapor
#

I just benchmarked this, almost twice as much

#

crazy

#

also, IMGui whiile in edit mode, still faster than uitk and more memory efficient

#

hope they'd fix this

small wigeon
#

that inline styles in uxml?

#

or set from code?

gusty vapor
#

code

gusty vapor
#

try it, and prepare to be dissapointed ๐Ÿฅธ

gusty estuary
#

back in rimworld days

#

Imgui took about 40% of frame time

#

kekw

gusty vapor
#

this is imgui for custom editors, not to be mistaken with the runtime uguii

gusty estuary
#

I talk about runtime imgui

#

the one that existed before uGUI

gusty vapor
#

I only tested them for custom editors

north verge
#

how can I create elements like these to select a component or object or smth?

gusty vapor
#

you want ObjectField

#

altho not quite sure tho if it's exposed in uibuilder due for a fact it's editor only element

#

you should check

north verge
#

doesnt look to be in uibuilder

rough scarab
#

You just have to switch the builder to editor authoring mode

acoustic trout
#

Hey! I have a list View that is fully set up and I can now use controller, mouse and keyboard to scroll through it, however, I can't seem to find good documentation on creating a 'Rotatable' or infinite scroller.

fiery mountain
#

anyone know of a nice way to get a color variable out of a style sheet? I defined some variables but I want something outside of the UI to share the color and only have the one defined place

gusty estuary
#

but overall it's not supported

#

so, it's going to be hacky either way

fiery mountain
#

yeah figured

small wigeon
#

create a visual asset with the styles and check resolved styles?

gusty estuary
small wigeon
#

you could do at startup and it wouldn't have to even be rendered, seem like it would be the simplest

gusty estuary
#

well, sure. But it's really hacky

#

allthough

#

๐Ÿค”

#

I do see a benefit of doing that project scope styles

#

so you can sync colors between not just UI, but maybe some gameplay rendering

small wigeon
#

<VisualElement name="colour1" class="colour1" />
Q("colour1").backgroundcolor
or something

gusty estuary
#

yeah, I get it

#

(there's probably an easier way by reading stylesheet directly though)

#

this is far more about variables

#

rather than styles

#

but since Unity doesn't support dynamically modifying stylesheet data

#

it's awful to work with

lyric nimbus
#

hey gang, is there a way to define a custom control in c# that uses a uxml file, for instantiation via the ui builder? ive been looking at the samples and i've worked out how to instantiate the element via my own code - but not just by placing it into the UI via ui builder. it seems like it should be dummy simple but i just can't nab it

lyric nimbus
#

yeah ive read through that page multiple times now and im still not sure it has any info that helps? i defined a factory and i can drag the custom control into the builder from the project tab of the element library, but it doesnt seem to actualy instantiate the uxml

gusty estuary
#

instantiate the uxml?

gusty vapor
#

@gusty estuary can we hide certain characters/letters in uitoolkit? are there even richtags for this?

gusty estuary
#

๐Ÿคทโ€โ™‚๏ธ

#

there's a big page

#

on rich tags

gusty vapor
#

I know, I found nothing regarding this

static canyon
gusty estuary
#

(or don't include characters in font kekw)

gusty vapor
#

lemme give this a shot!, thanks!

gusty vapor
static canyon
#

I use this method for a fake type-writer effect

gusty vapor
#

but that's fine, I can still use it

static canyon
gusty vapor
static canyon
#

yea.. slow progress and even when they do, don't expect it in anything <2023 either

gusty vapor
static canyon
gusty vapor
#

@gusty estuary remember my rambling regarding data pairs in DropdownField from the other day? turns out what I want was PopUpField

#

๐Ÿคฃ

#

it can do custom data type ootb

#
    using System.Collections.Generic;
    using UnityEngine.UIElements;
     
    public class MyData
    {
        public string name;
        public int id;
    }
     
    public class MyPopupField : PopupField<MyData>
    {
        public MyPopupField() : base(GenerateExampleData(), 0)
        {
            formatSelectedValueCallback = FormatItem;
            formatListItemCallback = FormatItem;
        }
     
        static string FormatItem(MyData myData)
        {
            return myData.name;
        }
     
        static List<MyData> GenerateExampleData()
        {
            return new List<MyData>
            {
                new MyData { name = "First", id = 1 },
                new MyData { name = "Second", id = 2 },
                new MyData { name = "Third", id = 3 },
            };
        }
    }

#

not mine, it's from Unity staff

#

that is embarassing, I thought that PopupFields were just a gimmick in uitk ๐Ÿคฃ

gusty estuary
#

the mystery is easily solved

gusty vapor
#

I was wrong

gusty vapor
acoustic trout
#

Using the new input system and the Ui toolkit I managed to get the D pad up and down working in my list view, however the submit button (A/X) does not seem to do anything .
I have added the Input system component on the eventSystem gameObject

small wigeon
#

check the input action configuration file

gusty vapor
#

@gusty estuary do you know what is happening here? why the parent (yellow bcg) doesn't retract/resize accordingly to the biggest child (on the left)

#

proly due to UnityEvents by default still use the imgui?

gusty vapor
#

removing it from hierarchy and re-inserting back fixed the issue... it's a bug for sure..

#

aparently unity used the same trick for their imguicontainer example

fluid spindle
#

Hello everyone, I have a problem with the UI Builder, when I add a object file I am watching the objects like this

#

instead of like this, which is made in code

#

what is happening, i tried to modify the shrink of the components of the object field but I can't

fluid spindle
#

Please help hahaha

gusty estuary
#

until it's your preferred height

fluid spindle
#

If I change the object file height the text is covered by the background of the button

gusty estuary
#

do you have editor theme selected btw?

gusty estuary
#

showing uxml will probably help

static canyon
#

You can also always use the debugger to inspect the difference.

fluid spindle
#

haha i think it is unreadable

fluid spindle
#

that grow is ok in 1 i think but i want to change the grow or the shrink in the components inside, which i cant

#

i tried by code but couldn't manage it

gusty estuary
fluid spindle
#
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
    <Style src="project://database/Assets/UIToolkit/Styles.uss?fileID=7433441132597879392&amp;guid=4a8b337d4f46bb548a9f33550ab4df11&amp;type=3#Styles" />
    <uie:ObjectField allow-scene-objects="false" label="AnimatorList" name="AnimatorListSO" binding-path="animatorsList" type="AnimatorListSO, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
    <ui:VisualElement name="AddAnimatorPanel" style="flex-direction: row; align-items: center; justify-content: flex-start;">
        <uie:ObjectField label="Add Animator" type="Doozy.Runtime.Reactor.Animators.UIAnimator, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" name="UIAnimatorToAdd" style="flex-grow: 1; flex-shrink: 2; height: -1%;" />
        <ui:Button text="+" display-tooltip-when-elided="true" style="height: 60%;" />
    </ui:VisualElement>
</ui:UXML>

#

kinda

#

i guess

gusty estuary
#

well, you have some weird ve structure for button

#

you also have flex grow on nested object field

#

flex grow means it will fill everything with share of value

#

if you have 2 elements with grow of 1

#

they will occupy 50% each

#

3 elements will 33.33% and etc

fluid spindle
#

i dont think it is relevant, that style is for "Label" and "Visual Element", but the problem is with components inside of the VisualElement component

gusty estuary
#

that style is not for label

#

that style is for object field on which it belongs on

#

elements created via code (that label) can't have styles applied to them in uxml

fluid spindle
#

Everythin here is created by UI Builder, the code was just and example, I wanted to re do it in UI Builder, if i put 0 for shrink and for grow at that style this happens

#

so how can i get this, i am willing to delete everything and start from scratch

#

but default objectfield is looking bad

gusty estuary
#

I'm not going to explain how styles work

#

lookup some examples in manual

#

there's plenty of them

#

there's also a huge section on how styling works

#

overall I'd suggest to just remove all styles alltogether

#

and if you don't want to read through manual

#

to just experiment one by one

#

and if style didn't do what you expect - remove it

#

because when stacked like you showed - they cancel each other out

fluid spindle
#

well, thank you very much sir

gusty vapor
# fluid spindle but default objectfield is looking bad

you can't do much with ObjectField, due to asset object selector is internal
you can just need to detach the object selector picker then transfor it to your other element..

I used something like this for my custom ObjectField

            // build the picker button (rip it out of the object field)
            VisualElement picker = obj[0][1];
            myCustomVisualElement.Add(picker);
#

it works OK

#

see the one with NO_IMAGE

#

also, you should check if the asset selector is exposed now, I made that with ancient uitoolkit version

gusty estuary
#

he wants it with ui builder (uxml)

#

but he attached a bunch of styles and it broke layout

gusty vapor
#

oh, my bad ๐Ÿ˜‚

fluid spindle
#

?

gusty vapor
fluid spindle
#

thank you @gusty vapor that looks super great

#

I actually got it fixed

#

I am pretty sure it was a bug

#

I'll show you give me a minute

gusty vapor
fluid spindle
#

prob I clicked some of those buttons at making some tests while learning of the tool

#

I didn't even remember

#

neither can believe it is intended

gusty vapor
past ermine
#

does anyone know how to keep the formatting? custom property drawer for condition and i add a Label and PopupField

whole bloom
#

Is there any ways to move to another UI XML file from the UI Toolkit via C#?
I'm very new to the UI Toolkit
on html/js it's something like window.location = "./other.html"
I mean like without changing scene

alpine vault
#

Heya ๐Ÿ‘‹ Is there a way to easily retrieve a specific cell inside a MultiColumnListView?

#

I want to call a method on a cell view whenever the user interacts with the seleced list view row - in particular, I want to enable edit mode of a "name cell" if the user presses F2 while having the row selected.

Right now I'm solving it by actually storing away the correct action when binding the row to a list view item, which works. But I wonder if there's a simple way to just retrieve a specific bound cell visualelement instead?

gusty vapor
#

I honestly don't know that MultiColumnListView exists ๐Ÿคฃ .. thanks for the info!

gusty estuary
alpine vault
alpine vault
gusty estuary
alpine vault
# gusty estuary ah, I see. In that case there is no API to access cells. And that is intended, b...

Well, the pooling mechanism makes sense. However, since those views aren't stateless to start with, and might be interactable, the pooling is not a good reason for not providing access to them. While I could go the unidirectional update path of triggering an update to an item, and pulling the state from the bound item, it sounds wasteful, mostly because UI Toolkit doesn't suggest this approach and I'm pretty sure it wasn't built for that (unless other UI frameworks like for example Compose).

#

I'm good with the current API set, so not a biggie, I just don't think it is good to say "it is intended" since the current API just makes the system more cumbersome to use for (what I believe to be) common use cases. In my opinion it feels more like a "not yet there" kind of feature that will (or should) land eventually.

gusty estuary
#

and fully managed their state

#

it's not exposed to you outside of delegates

alpine vault
#

Yeah ๐Ÿ‘ But that API would suggest "never interact with those view elements" outside of those delegates.

gusty estuary
#

exactly

#

for all interactions you use related View API instead

#

which has on click events and etc

alpine vault
#

Which either means:
a) It is absurdely cheap to rebuild / rebind which would favor putting the state into the item.
b) just hook into the binding mechanism to do your dirty work

#

Although I would love to believe a) is the case, I doubt that it is really that efficient to hoist the state that high

gusty estuary
#

idk about multicolumn list view

#

but normal list view uses virtualization

#

I'd assume they all are like that

alpine vault
#

That's some good knowhow - render me curious ๐Ÿ™‚ I'm going to delve deeper into that area.

gusty estuary
#

also

#

it does have an update method per item

#

by index in source list

alpine vault
#

Yeah ๐Ÿ‘ Which means theoretically I could use that to push down state changes to the binding delegate.

#

Probably the cleanest approach for what I try to do

gusty estuary
#

yep, that's what it does

#

allthough structural changes (adding/removing elements) will require rebuilding everything (valid for ListView)

#

not sure if multi is same

#

actually not full rebuild, but RefreshItems

#

which is Rebinds all items currently visible.

#

according to docs

alpine vault
#

Yeah, that kind of makes sense. I know Android's RecyclerView had such a high complexity to work around these kind of rebuild issues.

#

Alright, I think I can take it from here in a good direction! I appreciate the rubber ducking chat ๐Ÿ˜„ rubberduck

weak fog
#

If I have two buttons A and B, how can I make it so that when I click on A it also "clicks" on B? I thought I should syntesize an event and do buttonB.SendEvent(event) but that just throws stack overflow

gusty vapor
#

show code for the sendevent you did

dire nova
#

I made some resizeable windows(also movable) but they break depedning on what left, rigth, top and bottom are set to (this is how I currentl do it):```cs
void ResizeLeft(Vector2 pointerDelta)
{
Vector2 position = transform.position;
float width = style.width.value.value == 0 ? resolvedStyle.width : style.width.value.value;

        float maxSize = Mathf.Min(worldBound.xMax, _maxSize.x);

        float newWidth = width - pointerDelta.x;
        float clampedNewWidth = Mathf.Clamp(newWidth, _minSize.x, maxSize);

        float deltaWidth = width - clampedNewWidth;

        Vector2 newPosition = position + new Vector2(deltaWidth, 0);

        style.width = clampedNewWidth;

        transform.position = newPosition;
    }
Any reccomendations what else I could do?
gusty estuary
#

how logic differs though?

#

maybe you can just keep it branchless

dire nova
gusty estuary
#

and instead modify position based on modifier

dire nova
gusty estuary
#

whatever it is that differs between what position values are

dire nova
gusty estuary
#

uuugh
instead of

if (negative)
target -= value;
else
target += value;

try to implement logic branchless:

var modifier = negative ? -1f : 1f;
target += value * modifier;
dire nova
#

Ohhhh, that would probably be a lot better. Didnt think of that, thank you!

analog scarab
#

I have a button that I can click - set on an overlay canvas. it even changes color when you click it. there's also an event system in the scene. but the linked function on the button doesn't get called. Does anyone know what I might be missing?

analog scarab
#

I think it may have something to do with the new input system.. but I can't be sure

#

although... the button is being clicked so.. it makes me think it's the event system

weak fog
spark axle
#

I'm having some issues with USS transition... is it supposed to trigger normally if the style is changed via code?

#

I have the USS transition properties set up properly (I think- I mean it shows fine when I add/remove classes in the editor)

#

but it won't trigger when I change the style directly or even change the class via code

#

also tried making sure it triggers a few frames later to make sure it has a "previous state"

spark axle
#

or any other alternative to animate a UIElement is welcomed

gusty estuary
#

Not all styles are fully animated

spark axle
gusty estuary
#

those should animate all right

eager barn
#

Are events added to an instantiated VisualTreeAsset shared across clones? All the ones I'm creating here when clicked return the last "i" value in the for loop. The debug log confirms that the correct "i" values are being set in the ctx though

#

It isn't calling the function for every button instantiated when one is pressed, but they're all holding the exact same value

eager barn
#

That is extremely strange then

gusty estuary
#

C# compiler codegen is playing trick on you here

eager barn
#

OH

#

wow it was

blazing tinsel
static star
#

Im using the textmesh pro TMP_Dropdown UI element and im adding items to the dropdown menu through code. I then want to add a method in their OnClick() event, how could I do this through code?

blazing tinsel
static star
#
            foreach (GripAttachment grip in primaryGun.compatibleGrips) {
                gripOptions.Add(grip.name);
            }
            foreach (OpticAttachment optic in primaryGun.compatibleOptics) {
                sightOptions.Add(optic.name);
            }
            foreach (MuzzleAttachment muzzle in primaryGun.compatibleMuzzles) {
                muzzleOptions.Add(muzzle.name);
            }```
#

@blazing tinsel

blazing tinsel
#

What is the type of gripOptions, sightOptions, muzzleOptions?

static star
#

sorry, its a list

#
        sightMenu.AddOptions(sightOptions);
        muzzleMenu.AddOptions(muzzleOptions);```
#

i then add these lists to their respective dropdown menus

blazing tinsel
static star
#

oh shit, wrong chat then

#

sorry, thought ui-toolkit was a general ui chat

blazing tinsel
#

But TMP_Dropdown has a onValueChanged event, use that to listen to the selection and react based on that

static star
#

im not familiar with unities event system

#

how would I do that

static star
#

thank you

#

@blazing tinsel is the same delegate called each time the value of the dropdown is changed? how can i specify which value of th dropdown has now been selected and pass that to the delegate

blazing tinsel
analog scarab
#

What does it mean when a button is clickable and changes color, but the associated function does not get called? I checked the code and the underlying selectable functions for color tints are getting called, but not the button OnClicked code - though I'm not sure if breakpoints even trigger when the code is unity package code.

#

Though actually just checked - and yes the selectable is also package code, so I guess they do trigger and so the button code really isn't getting called. not sure where it's supposed to be being called from

gusty estuary
analog scarab
#

I don't understand, I'm not disabling a UIDocument

#

I'm just setting the function on the button object

#

Just like this

#

and the color does change when I clock the button, but the function does not get called

gusty estuary
#

oh

#

you're in a wrong chat

analog scarab
#

ah! ok thank you

gusty vapor
#

man, why they made selectionChanged callback wouldn't get triggered even after ClearSelection for 0 index

#
listv.ClearSelection();
listv.SetSelection(0); //if it's 0 it won't trigger even after clearing
#

OH! I think i should use selectedIndicesChanged instead ๐Ÿ˜† .. yeah

fallow nebula
#

Hello. What is the best practice for placing the UI documents xml files? Do they belong alongside other cs scripts? Or do I treat them as assets (okay I know scripts as assets too but I hope you know what I mean)? Or perhaps in Resources?

wanton solar
#

Hi guys, i am once again asking for your support about understanding the Experimental GraphView.
I just want to notify an error whenever my custom DSNode class (which inherits from the basic Node one ) has something wrong, such as the empty name or something like that.
I wanted to use an Icon badge class, but whenever i try to attach it to the node it display me this error:

"Attacher: The element and its target must be in the same visual tree hierarchy" and the visual element passed in input seems to be null

i know what a tree hierarchy is, but i don't know how to add correctly the badge to the node. I tried node.hierarchy.Add(iconBadge) and it works somehow, but this makes the attach function of the icon badge useless and i'm feeling like i'm missing something.
Any tips?
Here's my code

trail oasis
#

ui toolkit is the most expensive thing in my entire game loop:

#

terrible performance

#

im getting like 20 fps when i animate a progress bar

gusty estuary
trail oasis
#

takes quite a lot of the frame

gusty estuary
#

At least half of it - compilation

rough scarab
#

Which notably wouldn't exist when built with IL2CPP

late loom
#

Hello people, I am a bit stuck using Unity UIToolkit in worldspace. I know there is no official support for worldspace UI but I have managed to make it work with position transform.
But the camera zoom seems to scaling the UI elements in a weird way, what is the best way to handle this?

gusty estuary
static canyon
raven grove
#

does this channel cover textmeshpro? getting a weird crash but want to make sure i'm in the right place before going on about it

small wigeon
#

I've pondered if you could hack TextCore to make worldspace text, you'd just need to create the mesh and set the material right?

gusty vapor
#

they're working to make z-order works in uitk, you can peek at vector api sources.. many on going stuffs related to this whole worldSpace stuff can be seen there

still condor
#

Question, how do i work the horizontal layout groups so that all the children like the text, images grow as well.

dark blade
#

so i want to target my group content container border color, and here is the hierarchy

#

did try this:

.pa-group:hover > .unity-scroll-view > #unity-content-and-scroll-vertical-scroll-container > #unity-content-viewport > #unity-content-container > #group-content-container {
    border-color: var(--pa__color__standard-focus-hover);
}``` or this:
```css

.pa-group:hover > .unity-scroll-view > .unity-scroll-view__content-and-vertical-scroll-container > .unity-scroll-view__content-viewport > .unity-scroll-view__content-container > .pa-group__content {
    border-color: var(--pa__color__standard-focus-hover);
}``` and this also:
```css
.pa-group:hover > .unity-scroll-view > .unity-scroll-view__content-and-vertical-scroll-container > .unity-scroll-view__content-viewport--vertical > .unity-scroll-view__content-container--vertical > .pa-group__content {
    border-color: var(--pa__color__standard-focus-hover);
}``` but none of those work, currently for work around is using this:
```css
.pa-group:hover .pa-group__content {
    border-color: var(--pa__color__standard-focus-hover);
}``` but ofc if  i nested group on another group, all of the content container border are get the effect, which looks bad...any idea the corrent way?
#

border width is already set to 1, so border is exists

upbeat storm
#
.pa-group:hover
{
   border-color: var(--pa__color__standard-focus-hover);
}

.pa-group__content
{
  // Style how you want here
}
#

Not only can you separate the styles out like this but you should be able to target nested elements as well just by creating a new class

dark blade
upbeat storm
#

@dark blade So I think I understand the issue that you are having a bit more and while it seems a bit messy, I think the best thing to do is what you have but use a different class to differentiate the two pieces of content. For example:

#
.pa-group:hover > .pa-group__content > .classOne {
    border-color: var(--pa__color__standard-focus-hover);
}

.pa-group:hover > .pa-group__content > .classTwo {
    //Different style for classTwo
}
#

This way "classOne" and "classTwo" will get applied to the respective panel's children, so you can affect the two nested pieces of content differently

#

I'm not an expert on CSS but that is how I would go about setting the two different styles (USS seems as if it would work a similar way)

dark blade
#
.pa-group:hover > .unity-scroll-view > #unity-content-and-scroll-vertical-scroll-container > #unity-content-viewport > #unity-content-container > #group-content-container
``` the differnt just now im not using ```#group-content-container``` anymore
dire nova
#

Is there a way to set an elements rect?

gusty vapor
#

when you're changing the size of the element, the layout.rect along with all other rects such as padding/margin's rects will be changed too according to that layout.rect

Also not quite sure what you mean by rect, I know what it is, but not sure which one you're referring to simply bcos lots of rects in a single uielement in uitoollkit unlike the legacy ui

#

you don't normally deal with Rects manually in uitoolkit, we have styles

astral compass
#

Hi, can someone help me to make a Visual Element perfectly square for all devices ?

dire nova
gusty vapor
#

many ways to do this.
The simplest is by basing either your width or height based on resolved value of width/height themselves

// in this case we use the height as our base for our symetrical square
// Cache this somewhere in a field
float aspectRatio = //Do your math here to get the aspect ratio after resolved;
float base = vis.resolvedStyle.height;

//1st initialization
//don't use Percent due to resolved value used
vis.style.width = base;
vis.style.height = base;

vis.RegisterCallback<ChangeEvent<GeometryChangeEvent>>(x=>
{
    vis.style.width = base * aspectRatio;
    vis.style.height = base * aspectRatio;
    aspectRatio = //Do your math again to update changed aspect ratio;

    //TODO: PUT A GUARD CLAUSE so it won't be recursive.. it's up to you
});
#

donn't worry, it's a simple math

#

once you nailed that, you can turn all those into three liners with mathf min/max

#

@astral compass

#

you can as well use padding trick for this, although it may work but there are edge cases where it can terribly fail

wise dawn
#

Hey guys. Does anyone have a link for a tutorial on how to make a slider/carousel on uitoolkit?

upbeat storm
#

I think UI Toolkit is fantastic but the downside is not many people have adpoted it, so we largely need to rely on the available documentation

wise dawn
#

Ive done it. Will try to post it somewhere at some time

upbeat storm
dark blade
#

hi is there anyone know good sample of List View Ui Toolkit, mostly that i found only created a List<int> then initialiaze for 1000element, then for listview.make item only create label....i mean how to use in real situation, a bit more complex so its give more informations, thank in advanced

upbeat storm
#

So instead of this:

#
 Func<VisualElement> makeItem = () => new Label();
#

Have something like this:

#
 Func<VisualElement> makeItem = () => 
{
  // build up UI here
}
dark blade
# upbeat storm You could take the base code in the sample and set it to a method in which you c...

sorry for late reply, just got back....but again this what i always found, like for real....there's only 0.000001% chance people ever create ListView just to hold label, this give so litle explanation, especially for me as beginner in this topic, lets say each element in my list view hold, EnumField, IntegerField, SliderInt...that the value later binding is from scriptable object field, how i supposed do that??,
in this quite better example https://docs.unity3d.com/Manual/UIE-HowTo-CreateRuntimeUI.html, unity create a new class, so what you think. do we need a class for each type element in List View?

dire nova
#

Why'd you need that?

upbeat storm
#

This means you ListView could contain custom elements that you create, so instead of instantiating a Label or an input field, you could instantiate "MyCustomControl"

#

This tutorial explains a little bit about custom elements and runtime UI but of course you can do the same thing for editor windows as well:

#

Today we're making custom components / elements based on VisualElement in Unity's UIToolkit (previously called UIToolkit). This has been really useful for me to reduce code duplication and make reusable, self-contianed UI pieces. This video is a little code-heavy, a little dense, but I hope it's helpful to anyone working with UIToolkit!

๐Ÿฆ‘ Where...

โ–ถ Play video
civic copper
#

Why may UI Toolkit inspector not work? I really have no ideas. I use 2022.2, and my property drawer works fine in another project. But this project completely refuses to call public override VisualElement CreatePropertyGUI(SerializedProperty property) { } method. Only IMGUI works. What's wrong?

rough scarab
rough scarab
rough scarab
civic copper
#

Do you mean this?

rough scarab
#

NaughtyInspector

#

that's your issue.

civic copper
#

What is it? Is it because of NaughtyAttributes?

rough scarab
#

Yup, they're overriding all MonoBehaviour inspectors, and they don't implement UIToolkit

civic copper
#

Oh my Gooooood

#

Thank you so much. I'll think it over

gusty vapor
#

I think wrapping it with IMGuiContainer would work?

still lantern
#

Is there a way currently to bind to a list with a custom element?
I want to make a chips/tags/labels group element, where each chip is a item in a string array. But not sure what a good way to go about this would be right now.

gusty vapor
still lantern
gusty vapor
# still lantern I mean, how do I actually set the binding

When it comes to ListView I always do binding manually via register callbacks due for a fact I always put complex logic in it, doing it via binding property is just too way of a hassles in terms of listview imho.. If you mean binding via binding property then my experience about it is a bit vague, sadly

still lantern
#

I love UITk, but boy do they make it hard sometimes...

gusty vapor
still lantern
gusty vapor
still lantern
# gusty vapor you want to make your own custom ListView?

No... sort of... but not really...
Basically, I have a list of strings. I want to make an element that creates a label for each of the strings in the list. I want to do this via SerializedProperty binding. So I would bind the custom element to the list of strings SerializedProperty.

#

Does that make sense?

gusty vapor
#

ah I see, yes that makes sense

still lantern
#

The way ListView does it is fully internal and is a special case.

gusty vapor
#

what listview does under the hood just have IList to contain the reference for the itemsource iirc

still lantern
#

Though they have rewritten ListView like 4 times, so you were probably correct at one point haha

#

Actually, you might be right...

gusty vapor
#

it is

still lantern
#

Yeah you are, but how does it update the size...?

gusty vapor
#

I remember we laughed when we saw it ๐Ÿ˜‚

gusty vapor
still lantern
gusty vapor
#

you can implemment your own ObservableCollection tho... just like what @gusty estuary didd

#

show me

still lantern
#

They just cache the array size, and in a Update loop check if the size is different ๐Ÿ˜‚

#

If so they unbind everything and rebind it

#

Really feels like the whole binding thing was a bit of an after thought

gusty vapor
still lantern
#

Gosh.. so using some reflection, it is possible to recreate 1- 1 what Unity does with the ListView binding natively

#

I'm going to do it. But I am not going to be happy about it!

#

(I need similar thing in a couple of places, so it will be worth it to be reusable)

gusty vapor
#

it is well known in this server that you're far more superior in terms of editor tooling than me, so I'd just trust your words ๐Ÿซก

still lantern
#

Haha, well I appreciate your help! Thanks! ๐Ÿ˜„

minor maple
#

Retained Mode vs. Immediate Mode: The UI Toolkit follows a retained mode rendering approach, whereas uGUI uses an immediate mode rendering approach. In retained mode, UI elements are only redrawn when necessary, optimizing performance by reducing redundant redraws. This can be particularly advantageous when dealing with many objects that update frequently.

#

that's cool

gusty vapor
#

UIToolkit still uses immediate-mode for most parts, but they're managed down level and wrapped quite nicely with top level api...
They learned their mistakes with the raw experience of immediate-mode in IMGui

gusty vapor
#

one that's obvious that is TextElement

still lantern
gusty vapor
#

yes they're still in lotta places

#

you can also see them mentioned lotta times in release notes from past versions

still lantern
#

huh

lean horizon
#

is there is a way to disable alignment ? i want visual elements to stack on top of each other instead of sharing part of the parent size

wintry depot
#

Ever since upgrading from 2021 LTS to 2022 LTS my custom fonts won't change color anymore
Anybody else experiencing this?

gusty estuary
trail oasis
#

since updating to 2023.1 i get this error for my custom element:

Element 'CustomUIElements.ProgressBar' has no registered factory method
#

any one know why? what have they changed?

timber trench
#

Hello

#

I need some guidance with starting out with designing the sprites and objects... Are there any free tools which are popular and I can learn those to start out with?

dark blade
#
        button = new Button()
        {
            text = "Btn"
        };
        button.bindingPath = "aaa";
``` i see button has bindingPath, but what is actually we can bind to it??, try to Bind Public Methods its not work i guess, since i put debug inside its, and didnt called
storm lion
#

I have officially ditched unity ui toolkit from lack of round button hit boxes to needing to use render textures everywhere with a million cameras just to display weapons in our load out selection this is jhust unusable

#

no click through on render textures is also ridiculous

trail oasis
#

uitoolkit has some serious problems if you want it to connect and update with game data

#

its really unmanageable

#

great for menus and stuff but not interactive game data

#

i had to ditch it too

#

the deeper you go with it , the more you realise its extremely flawed

fringe stump
#

does anyone know if there is a way to set a margin on all child elements except the last in USS?

#

basically I want to put space between elements

civic copper
#

Is there something like AdvancedDropdown from IMGUI in UI Toolkit?

#

DropdownField is not the same, there is no search field

errant harbor
#

Why do my UIToolkit based custom attributes work in Unity 2021 but not unity 2022?

I thought 2022 is suppposed to support UIToolkit more and yet it seems to be the other way around.

This is incredible frustrating because now i can't upgrade to 2022

Am i not supposed to override CreatePropertyGUI in the property drawer?

#

It says NoGUIEmplemented in place of where the field should be in 2022. But it works fine in 2021

urban totem
#

hey does anyone know when ui event callbacks are fired relative to the execution order of scripts (Update/LateUpdate) within a given frame?

gusty estuary
urban totem
#

That's a good idea

dark blade
rough scarab
errant harbor
#

Have tried creating attributes in new projects

spark axle
#

is there something like the animator for UI toolkit elements?

gusty estuary
#

but nothing like animator

spark axle
#

I'm struggling with something as simple as position a newly instantiated element...

#

whatever value I try to print always says it's NaN or null

#
var variance = Random.Range(0, _chicken.resolvedStyle.width);
var targetLocalPos = new Vector2(variance, _chicken.resolvedStyle.height);
var worldPos = _chicken.LocalToWorld(targetLocalPos);
var fxLocalPos = fx.WorldToLocal(worldPos);

fx.style.bottom = fxLocalPos.y;
fx.style.left = fxLocalPos.x;
#

code makes perfect sense to me so I'm confused when this sets the top of the fx element to the top of the target (chicken)
but changing the 2nd from last line to set to the "top" makes it place the top of the fx element to the bottom of the target

rough scarab
spark axle
#

so I should wait a frame after instantiating before positioning any element?

floral lantern
#

do I need to get reference to the slide bar? Here's the code I have from looking up but doesn't seem to work.

{
    public Slider healthSlider;
    Status playerHealth;
    // Start is called before the first frame update

    private void Awake()
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");
        playerHealth = player.GetComponent<Status>();
    }
    void Start()
    {
        healthSlider.value = CalculateSliderPercentage(4, 2);
    }
    private float CalculateSliderPercentage(int currentHealth, int maxHealth)
    {
        return currentHealth / maxHealth;
    }

the number 4 and 2 are just placeholders, so ignore them. But the error is saying the slidebar is null

#

slider is a component right?

#

I tried getting componet usign healthSlider = GetComponent<Slider>();

#

but it shows another error

#

weridly enough in all the tutorials I'm seeing, they dont' even have to set the reference for slider and it just works

#

so ping me pls if someone replies

dire nova
#

I've been running into a weird issue where Focus() doesnt work after passing a TextField as VisualElement:


        //In the first script
        void InitializeTextField()
        {
            TextField textField = ConsoleControl.Q<TextField>();
            UIManager.Instance.SelectOnVisible = textField;

            textField.RegisterCallback<KeyDownEvent>(e =>
            {
                if (e.keyCode == KeyCode.Return)
                {
                    string input = textField.value;

                    textField.value = string.Empty;

                    ProcessInput(input);

                    textField.Focus(); <-------------------------------------------------- Works great
                }
            });
        }
   
        // In the second script (UIManager)
        public VisualElement SelectOnVisible { get; set; }

        public void ToggleVisibility()
        {
            IsVisible = !IsVisible;
            UIDocument.rootVisualElement.visible = IsVisible;

            if (IsVisible)
            {
                Debug.Log("1");

                SelectOnVisible?.Focus(); <-------------------------------------------------- Doesnt do anything

                Debug.Log("2");
            }
        }
floral lantern
zinc basalt
#

Hello, I hope you're doing well. Today, I tried using the Unity ToolKit to improve the UI of my game. I followed a YouTube tutorial to create a login panel with interactive buttons (the buttons change their appearance when hovered over with the mouse). In my scene, I have the UI Document from the ToolKit, a Canvas, and an Event System with the new Input System.

Here's my issue: The buttons are not clickable, and they don't perform any action when clicked or hovered over with the mouse. However, everything works fine in the Preview mode within the UI ToolKit Editor, so there doesn't seem to be any errors in scripts or anything like that. Interestingly, when I remove the Canvas from the scene, the buttons work in the game.

I'm wondering why this is happening and how I can fix it. Any help would be greatly appreciated. ๐Ÿ™‚

gusty estuary
#

that's uGUI

#

not UIToolkit

zinc basalt
#

That is ui Toolkit. I have the UI document from UI Toolkit and a other canvas in my scene.

#

So, I have coded the buttons from the toolkit and in the preview mode it works great but in the scene with a canvas it is not working

gusty estuary
#

What do you mean by canvas?

#

Can you show?

zinc basalt
#

I can show when I am home. Thanks for your help, I try to explain better at home

winged oak
#

Hi, i am currently stuck on what i start to believe may be a bug; naturally, PointerEnterEvent, as well as PointerLeaveEvent, and their equivalents PointerOverEvent and PointerOutEvent, should only fire once (i also tested the Mouse Events), when i move the mouse above- or away from a visualElement.

So if for example i move the mouse over a visualElement, the PointerEnterEvent should only fire once, same for when i leave the visualElement.

But in my case, i keeps rapidly firing these events- even if i do not move the pointer anywhere. This seems broken.

gusty estuary
winged oak
#

i am using evt.StopImmediatePropagation(), which should prevent any propagation to other elements.

gusty estuary
#

it's not propagation

#

it's firing

winged oak
#

oh ok, could you explain the difference please?

gusty estuary
#

it gets fired multiple times

#

not just once

#

so whatever you are stopping

#

is stopped

#

but next event that gets fired is not same instance

winged oak
winged oak
#

to be accurate, i mentioned all 4 in my initial message ; ) But i am using the PointerOverEvent and PointerOutEvent in my code, as they dont fire to descendants.

Here for example:

public void OnMouseLeave(PointerOutEvent evt){
  evt.StopImmediatePropagation();
  bool test = evt.bubbles;
  VisualElement item = evt.currentTarget as VisualElement;
  if(item.name != "item") { return; }
  if(currentHover == null){ return; }
  Tooltip.style.display = DisplayStyle.None;
  currentHover = null;
  item.ReleasePointer(evt.pointerId);
  Debug.Log("PointerOut fired ...");
}
#

I believe this should only be triggered once, thats what docs say too. But it just keeps rapidly firing like a machine gun, and the weirdest part- it even fires if i do not move the mouse, which conflicts with the logic of this Event.

gusty estuary
#

ahem

#

what exactly are you doing when mouse enters element?

winged oak
#

goal is to show a tooltip, which is this line:
Tooltip.style.display = DisplayStyle.None;

the other stuff (except for evt.StopPropagation()) does not belong there and was added for debugging.

gusty estuary
#

oh

#

well

#

what might happen

#

is that you show tooltip

#

which triggers leave event because pointer is not over initial element

winged oak
#

bro... this could be it... omg

gusty estuary
#

that triggers tooltip to be gone

#

and...

#

I actually solved this somehow

winged oak
#

yes this makes sense, i will test this and report back to you

gusty estuary
#

here's my tooltip implementation

winged oak
#

lol you even multithreaded this, nice man, looks very clean on first glance ๐Ÿ‘

gusty estuary
#

I didn't

#

It's just async

winged oak
#

but wouldn't async still start its own worker?

gusty estuary
#

no

winged oak
#

i see i confused it then, so async = mainthread (i will keep in mind)

gusty estuary
#

almost none of Unity managed stuff is thread safe

winged oak
#

i tried to get into multithreading looking into DOTS and multithreading in general, did this for 6 months around and the result: i never made it to move enemy units (transforms) on a real thread (own worker, not mainthread). For the moment, i gave up on it.

winged oak
dire nova
dire nova
#

I found one but it's still not doing anything

zinc basalt
# gusty estuary canvas?

Hi, I want to use the ui toolkit with a canvas because I have a lot of stuff in the cavas and I only use the toolkit for some elements. Is that possible?

That is my UIController script. The script is on the UIDocument(ToolKit). It works great in a other scene without a canvas. ```using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;

public class UIController : MonoBehaviour
{
public Button loginButton;
public Button regButton;

public string loginButtonName;
public string regButtonName;


// Start is called before the first frame update
void Start()
{
    var root = GetComponent<UIDocument>().rootVisualElement;

    loginButton = root.Q<Button>(loginButtonName);
    regButton = root.Q<Button>(regButtonName);

    loginButton.clicked += LoginPressed;
    regButton.clicked += RegButtonPressed;
}
void LoginPressed()
{
    Debug.Log("Login Butt pressed!");
    loginButton.style.display = DisplayStyle.None;
}

void RegButtonPressed()
{
    Debug.Log("Reg Butt pressed!");
}```
#

Some Screenshots

dire nova
gusty estuary
#

yeah, input overlap will require hacks to work

#

or maybe it's easier

#

but anyway

#

combining 2 completely different systems is uuugh

zinc basalt
#

Ok I will try to create the old UI from the canvas to the Toolkit as new Design

rough scarab
tidal spire
#

oops, sorry

dark blade
#
.pa-spesific__slider-field>.unity-base-slider__input>#unity-text-field>#unity-text-input {
    -unity-text-align: middle-center;
    /* -unity-font-definition: var(--pa__font-definition__poppins-black); */
    -unity-font: var(--pa__font__poppins-black);
    color: var(--pa__color__universal-field);
    transition: color 0.2s ease-in;
}
``` this is one of many thing i dont understand about UI Toolkit, so i made a "tools" using unity 2022, and use it in my project with unfortunately are using unity 2021.3f, ofc i expect some if not many of them would broke, but even simple as overriding -unity-font or -unity-font-definition become a problem, in unity 2022 when im using -unity-font its didn't work, and font definition are, but on unity 2021, now font definition are not  work, yet unity font are, and its give error assertion failed, which take me an hour to find it -_-
#

and in unity 2022 i can use

--pa__font-definition__poppins-black: url('/Assets/Editor Default Resources/Fonts/Poppins-Black SDF.asset');
``` which can simply right click on asset, select copy path and add "/" at front, then everything good, yet  in 2021 that didnt work, so i need to create UXML document and add my USS there, then give path from there, which become
```css
--pa__font-definition__poppins-black: url('project://database/Assets/Editor%20Default%20Resources/Fonts/Poppins-Black%20SDF.asset?fileID=11400000&guid=6b52a25dbf94c1e43873ff253fb20815&type=2#Poppins-Black SDF');
``` like how am i supposed to know  that path, except must create a dummy uxml document just to let unity give proper path
lyric adder
#

Anyone have any success getting Emoji to show up in editor inspectors? I'm on the bleeding edge of 2023.1 + TMPro-4.0.0-pre2, trying to get UIToolkit to use TMP's sprite atlases, but no dice.

fallow badger
#

Can I refer to Text Mesh Pro font in UI-toolkit styles?
Or I have to do .asset twice with the same font - one for ui-toolkit and one for text mesh pro?

lyric adder
#

@fallow badger my understanding is that TMPro-4.0.0-pre2 unifies the font asset formats between TMP and CoreText (which is what UIToolkit uses for font rendering). From the upgrade notes, it sounds like you need to regenerate all of your font assets after upgrading to TMP 4. It sounds like it's still only half baked tho, so if you're anywhere near shipping, sounds like you have to duplicate font assets for now ๐Ÿ˜ฆ

fallow badger
unborn bluff
#

How can I disable the interaction with a Toggle for a user? Picking mode ignore doesn't seem to work for Toggles.

gusty vapor
#

before 2022 lts the method to override is HandleEvent

modern cypress
#

Hey, I have a dropdown menu in which the different options are displayed using absolute positioning since I don't want the rest of the fields to move up/down when toggling the dropdown. However, this is the situation I find myself in. Is there a way to stablish visual elements render priority? Any tip on how to solve this issue is welcomed

unborn bluff
#

@gusty vapor thank you!

boreal compass
modern cypress
gusty vapor
#

all this can be solved with just absolute position atwhatcost

#

and use the top/left/right/bottom for anchoring with a percent value

#

OR

#

just have a dummy parent with relative position, and your dropdown is set to absolute position so you dont have to deal with anchoring at all

wise dawn
#

Does uitoolkit support gif? If not whats the solution?

errant blade
#

Has anyone encountered issues with upgrading their unity project to 2022 LTS? Some things broke like materials, but they were easy to fix. However, all of our UI seems to have been messed up when upgrading, with elements and their sizes randomly changing some places, while others remain untouched after the upgrade

boreal compass
#

Yeah, I saw some things break with regards to position. It was mostly absolutely positioned elements with 100% width that no longer take into account parent padding when calculating the percentages

little horizon
#

I'm building a inventory system using UI Toolkit. I just can't seem to get the correct position of a inventory slot when clicking it. It's always off a tick. The blue arrow is where I click (and what shows the visual) but the actual first inventory slot is around the red square. Anyone got any tips?

#

Seems to be off by about 14 x value and 34 y value. No idea why.

#

I also feel like there HAS to be a better way to get the element at mouse position. Currently I'm getting all VisualElements under what I clicked and search for a specific element at that position (inventorySlot).

gusty estuary
#

one thing to keep in mind: height values seem to be inverted when you use mouse position from input systems

gusty vapor
#

Yes, due to InputSystem's uses bottom as 0 for y, and positive values going up, meanwhile uitk uses the opposite of those

flip it yPos = Screen.height - yPos then convert it to local pos

wind gorge
little horizon
little horizon
little horizon
little horizon
wind gorge
#

element.RegisterCallback<ClickEvent>(evt => {})

gusty vapor
#

if((VisualElement)evt.target == cell)

wind gorge
#

Yeah, but then you have to figure out what data the cell holds

#

Which means you either put the data in userdata (which is dumb) or you put it in a dict

#

Much easier to create cells in a loop and capture the data in a closure

gusty vapor
little horizon
#

This is all Klingon to me

#

Funny thing is, I've tried using the old ways (UI Canvas): same issue

gusty vapor
#

there are runtime helpers if you're using Panel, but can't quite remember which ones

static canyon
#

^ you want to use RuntimePanelUtils and find the right combo for your hierarchy & what you're trying to calculate RuntimePanelUtils.ScreenToPanel(visualElement.panel, new Vector2(Screen.width, Screen.height));

thick quarry
#

Good [insert general timeframe in your locale]. I'm creating a UI with a toolkit, and I would like to have a visualelement inside my uxml file that is only visible when the game is not running. I'm dynamically creating a bunch of elements, so I don't have those populated until the game runs. This works well, but it is difficult to visualize style changes etc.

midnight wyvern
#

Hi, I created a document with UI Builder and noticed margin collapse doesn't work. Is this feature not implemented in uss or am I doing something wrong?

boreal compass
boreal compass
zinc basalt
#

Hello, sorry for such a simple question, but google gives me mostly results for older versions of unity which do not use the UI Builder.

I want to change the scroller low and high button.

I see the elements in the hierarchy but they are greyed out for some reason (see image) Thanks for your help.

boreal compass
past ermine
#

does anyone know why a custom Editor, using UIToolkit throws an error SerializedProperty Mechanics.Array.data[0] has disappeared! when using DeleteArrayElementAtIndex?

#

it seems to me the PropertyField isn't removed correctly.

pine glacier
zinc basalt
#

And when I want to change the style of the text from the input field, what I need to write? .unity-input-field > ...?

thick quarry
boreal compass
boreal compass
coarse portal
#

Hi, does anyone know how the ItemsAdded event in UIElements.Listview works? I can't get it to work

coarse portal
#

ListView questions

grave copper
#

I'm having a hard time getting button presses to register.

I've enabled TouchSimulation, and I'm trying to get a button with an attached script to fire, but the click isn't being registered I don't think. this is my input.
I've enabled all of the actions in a script, and they all come back with enabled

#

since it's a touchscreen I use press for buttons and a separate release to end drag. but if I make an alternative inputasset with just press it still doesn't work, so I don't think drag/release are blocking it

#

my drag and release are both definitely working

#
        TouchSimulation.Enable();

        touchPressAction = InputActions.FindAction("Press");
        if (touchPressAction != null)
        {
            touchPressAction.Enable();
            Debug.Log("Touch press action enabled");
        }
        else
        {
            Debug.LogError("Touch press action not found!");
        }

        touchDeltaAction = InputActions.FindAction("Drag");
        if (touchDeltaAction != null)
        {
            //touchDeltaAction.AddBinding("<Touchscreen>/primaryTouch/delta");
            touchDeltaAction.performed += OnTouchDelta;
            touchDeltaAction.Enable();
            Debug.Log("Touch delta action enabled");
        }
        else
        {
            Debug.LogError("Touch delta action not found!");
        }

        touchReleaseAction = InputActions.FindAction("Release");
        if (touchReleaseAction != null)
        {
            // touchReleaseAction.AddBinding("<Touchscreen>/primaryTouch/press");
            touchReleaseAction.performed += OnTouchRelease;
            touchReleaseAction.Enable();
            Debug.Log("Touch release action enabled");
        }
        else
        {
            Debug.LogError("Touch release action not found!");
        }```
#

this is my button setup

#

yeah if I add a listener it's definitely firing, but nothing is happening in my button

#

I've followed the tutorials exactly, I'm not sure what else I need

#

is my input not being sent to buttons?

grave copper
#

ok I was missing an EventSystem because I made my first button in a prefab

#

yay fixed

rough scarab
zinc basalt
#

Hello,

I'm encountering an issue with a scroll view in Unity using the ui toolkit. I programmed a display with a scroll view and set the touch scroll type to elastic in the toolkit editor. However, every time I save the project, it automatically reverts back to clamped. I'm not sure why this is happening and would appreciate some assistance in resolving this issue.

Thank you!

still lantern
#

So... can someone confirm for me that a Toggle element that is a child of a Foldout element, will trigger the ValueChanged event for the foldout when the Toggle value changes...? Am I going crazy?

#
 var foldout = new Foldout();
            
foldout.text = "Test";
foldout.value = true;
            
foldout.RegisterValueChangedCallback(evt =>
{
    Debug.Log($"Changed: {evt.newValue}");
});
foldout.Add(new TextField("Field"));
foldout.Add(new Toggle("Toggle"));

rootVisualElement.Add(foldout);
#

Wait... so if you have one field a child of another field, it will propagate the event up if it is the same type... how does that makes sense...?!
(Child one IntField to another IntField, changing the child raises the parent change event)

gusty vapor
still lantern
gusty vapor
#

it might be captured by the foldout when you clicked the toggle.. also make sure you're not doing something funky with the layout of your foldout ๐Ÿ˜„

#

also try to clear all your margin, padding, width and height too(if any) and see

still lantern
#

Ooh, you might be right it might be picking it up from the click maybe...

#

No that doesn't make sense since the toggle itself isn't overlaping

#

Picking mode didn't do anything btw

gusty vapor
still lantern
#

I mean, looking at it in the Debugger

gusty vapor
still lantern
gusty vapor
still lantern
gusty vapor
#

worth a try

still lantern
still lantern
gusty vapor
#

no biggie, used to be you to help me out lol ๐Ÿ˜† kinda weird this time ๐Ÿคฃ

gusty vapor
still lantern
gusty vapor
#

then it is a bug, yeah

#

proly mention it in your forum post as well

still lantern
#

Yeah good idea.

still lantern
tepid gazelle
#

does setting font text to % instead of px work? i cant seem to get my text to scale as a percentage

tepid gazelle
#

is that a bug? also is there something that needs to be "enabled" to have text scale with its parent element? not sure which setting it would be

gusty estuary
#

that's just not supported atm (at least was back in 2022.2)

#

but considering px scales

#

not much lost

tepid gazelle
#

what do you mean px scales exactly?

gusty estuary
#

it scales with screen resolution

#

well

#

if you set up scaling settings in panel settings ofc

tepid gazelle
#

ahh panel settings ok

gusty vapor
gusty estuary
#

if people wanted they'd write their own text renderer ๐Ÿ˜…

tepid gazelle
#

it would be simpler if unity supported it rather than have options that do nothing @gusty vapor

gusty vapor
tepid gazelle
#

oh boy worldspace is still only planned on the roadmap?

gusty estuary
#

z space - sure

#

but world space - uuugh

tepid gazelle
gusty estuary
#

for world space text ofc

zinc basalt
#

Hello,

I'm encountering an issue with a scroll view in Unity using the ui toolkit. I programmed a display with a scroll view and set the touch scroll type to elastic in the toolkit editor. However, every time I save the project, it automatically reverts back to clamped. I'm not sure why this is happening and would appreciate some assistance in resolving this issue.

Thank you!

thick quarry
#

Only show in editor

merry furnace
#

Hi everyone. I'm trying to understand hoe to use the UI Toolkit (UI Builder) and how to properly display the UI to look the same size across different platforms, but I'm confused as to what the aspect ratio is affecting the size of my UI elements during gameplay. Do you guys know a guide on educating how to deal with aspect ratio and UI Toolkit?

wise dawn
#

I dont know any guides

#

But i would use the flexbox properties the most possible and % instead of px

#

After that whats missing i would use media queries for different screens

#

For images svgs if possible(you have to doenload the vector image for uitoolkit library)

boreal compass
hard pewter
#

I have custom PopupWindow and for some reason im having a really hard time trying to shrink that Label in a TextField. I cant inspect it in UI debugger cause its a popup window so any event outside of it closes it XD

#
public override void OnOpen()
    {
        textField = new TextField() { label = labelName};
        textField.value = initialValue;
        var button = new Button(() => { action.Invoke(textField.value); editorWindow.Close(); }) { text = "OK" };
        var root = editorWindow.rootVisualElement;
        root.Add(textField);
        root.Add(button);
        root.style.marginBottom = 5;
        root.style.marginTop = 5;
        root.style.marginLeft = 5;
        root.style.marginRight = 5;
        root.style.justifyContent = Justify.Center;
        textField.Q<Label>().style.width = 20;

        textField.RegisterCallback<KeyDownEvent>(evt => {
            if (evt.keyCode == KeyCode.Return)
            {
                action.Invoke(textField.value);
                evt.StopPropagation();
                evt.PreventDefault();
                editorWindow.Close();
            }
        });
    }
#

I just cant freakin set that width inline...

hard pewter
#

its so stupid...
cant set its width, its totally rigid, but this works ๐Ÿคฎ

#Popup>TextField>Label{
    margin-right: -40%;
}
wise dawn
#

show me your uxml

#

@hard pewter

hard pewter
wise dawn
#

Oh you didnt do an uxml, so try something like this

#

new Length(20, LengthUnit.Percent)

#

for the width, not sure tho

hard pewter
#

idk man, for some reason it is unchangable...

#Popup>TextField>Label{
    width: 20%;
}

does not work

wise dawn
#

not that

#

textField.Q<Label>().style.width = new Length(20, LengthUnit.Percent);

hard pewter
#

I attached a style sheet to that popup btw to see if this changes anything, but nope

hard pewter
#

literally like width cant be altared in any way

#

I mean... it looks fine now

#

only doing it by setting margin to -40% seems illegal XD

wise dawn
#

look, textField.Q<Label>().style.width = 20; you are querying for a Label

#

Can you make sure that the TextFiel has a Label child

hard pewter
#

I already did

wise dawn
#

what happens if you instead of querying for a Label

#

you query the TextField

hard pewter
wise dawn
#

makes sense

merry furnace
#

Thank you @boreal compass and @wise dawn. I realized I needed formal training so I just signed up for unityโ€™s pro training catalog once I became aware of it. Iโ€™m moving so slow because I am learning how to operate specific components as I need a them rather than being aware of whatโ€™s available which may be the source of my confusion. I will take your suggestions, so thanks again!

wise dawn
#

They teach uitoolkit?

merry furnace
#

Not that I can see yet. I read for UI Toolkit they are focused on the editor and plan to expand on runtime features in 2-3 years, so I might have to use legacy UI canvas and such

wise dawn
#

Ok thats good

#

Not sure if this is still in their plans, but eventually UItoolkit will "replace" legacy

#

But i hope at that time the documentation they have will be better, or even called a documentation

boreal compass
#

I've heard UI Toolkit is the future as well

merry furnace
#

I saw that too. I will try to incorporate both, but a lot of my problems were that I didnโ€™t know anything about how to deal with UI. I can see how there are UI specialists as career path. Hopefully this training will clear a lot of questions and I can use the documentation as you both suggested.

wise dawn
#

training is important, but tbh

#

the best is for you to make a lot of games

#

different ones, diferent logics

#

another thing that im noticing now

#

even this discord, the names of the chats, are a hint for what you need to learn and try in your games

#

and Good luck with your learnings man, we are here to help and require for help aswell ahah

merry furnace
#

Thanks! Much appreciated ๐Ÿซถ๐Ÿป

modern cypress
#

Hey, I was messing around with the dropdown option and I realized that pressing a key "selects" the next option starting by that character.

So, here is my question. Is there a way to tweak this default functionality so that I can type full words like if I was using a search-bar? I have seen this done in different websites, but I do not know if it can be done using the UI-Toolkit without creating an entire custom dropdown element

dark blade
#

so i want when i attach nav item to nav bar, its trigger on attach event inside nav item, to check if its attached to visual element that is Nav Bar, since afaik we can't prevent a thing to attached and become a child, and i do like this

        private void OnAttach(AttachToPanelEvent evt)
        {
            if (this.parent is PANavigationBar parent)
            {
                this.parent = parent;
                this.parent.AddItem(this);
            }
            else
            {
                Debug.LogWarning("This Item Should only be child of PANavigationBar, thus this will be ignored");
            }
        }
``` but seems its incorrect, since its goes to else, and log warning is called, what is the correct way to use Attach To panel event?
small wigeon
#

are there any free libraries of controls? I need a little progress circle

rough scarab
small wigeon
#

I realised what I was going to do doesn't exactly make sense so don't worry about it ๐Ÿ˜„

#

but is this really the expected way to style normal progress bars?

dark blade
small wigeon
#

Ah yes, thank you

#

But it seems a bit ridiculous that I need 5 styles to modify one component

wet lance
#

Hello there! Did anybody meet such problem when property fields are always disabled?

cursive otter
rough scarab
cursive otter
rough scarab
#

Either way my workaround works fine and you can use the file path attribute

cursive otter
#

Code above identical to his

rough scarab
#

I am on phone and haven't tested their code, I just know the fix works for that scenario

cursive otter
#

Strange

wet lance
#

by default my ScriptableSingleton has HideAndDontSave hideflag
HideAndDontSave = DontSave | NotEditable | HideInHierarchy

rough scarab
#

Maybe you have to restart for it to occur, it really doesn't matter imo

wet lance
#

so yeap it's NotEditable, but why is that

cursive otter
#

In my case they are not KEKWlaugh

cursive otter
#

I've tested without Unity reboot

#

Yah that's it, it set's flags after reboot

wet lance
#

Or the case it that the problem occurs only after Unity reboot?

wet lance
#

Got it. Unity adds NotEditable flag if there is no saved file upon initialization. Since I've saved it for the first time I don't need to change HideFlags manually even after Unity reboot

#

So I've removed hideFlags hack and it still works

cursive otter
#

Yeah the reason is Save not beeing called, if we save actual asset (in project folder outside of Assets) it sets proper flags

#

Well that's makes sense for such persistent things, as if there is no file yet - nowhere to save this persistent data

wet lance
gusty vapor
#

@gusty estuary is it possible to force uielement to be resolved this frame?

gusty estuary
#

No idea

gusty vapor
#

man this is pain kekwait

#

trying to mimic the overrideSprite in the legacy ui

plain quail
#

Would you guys say that the toolkit/builder is good to use now in production? I want to make a game that works on a variety of mobile screens.

small wigeon
#

Yes, unless it doesn't support something you need (see pin)

wind gorge
dark blade
#

so here is my Editor Window, its use UI Toolkit, and i have 3 question,

  1. how to get center position of my screen.
  2. How to get center position of my Editor Window, relative to its position.
  3. How to get position of my refresh button(the one with blue color, with restart icon) relative to Window Position
    thanks in advanced
molten sun
#

Just made a start on learning UI Toolkit today, and want to try to get my head around how it all works whilst avoiding picking up too many bad habits. On a very basic level, how do you guys deal with hiding and showing 'pages' for runtime UI? For example, I have a main menu containing a few elements including a 'Settings' button. When I click on it, I'd like to get rid of all those buttons, then have a new load of buttons appear. If I go back a layer I want those original buttons back. Another example could be for switching back and forth between tabs in a character inventory type window. From my cursory exploration of UI Toolkit it seems like this is a really good fit for this type of use, as I assume I can somehow just stack a UXML Template inside another then swap out the one inside. If so, then how would I remove and replace it properly? Otherwise, what other options are available for this, such as in the case of overlaying a second window over the first rather than replacing it or imbedding it with the old structure?

molten sun
#

Thanks kuolema. I've been through the tab example before, and I have to admit that while I can replicate the steps and have it work I still don't really get it yet, hence why I posted here. In the interests of not wasting anyone else's time I'll have another shot at dissecting it though, as I'm sure I'm just missing something really obvious.

boreal compass
#

It's pretty straightforward, but you're welcome to ask anything you don't understand, that's why we're here

gusty estuary
#

@gusty vapor do you know how to properly update custom property drawer?
Basically I want to have a button which says Select entity or Entity not found based on whether entity exists. Is there an event to use for updates or smth?
It's way too specific, and I doubt I can use binding path for that anyhow

#

or maybe I should just use imgui? ๐Ÿค”

gusty vapor
spark flume
#

why doeant the heigth change of my UI? i have it on 9% but its still 100%

gusty estuary
#
    public static void TrackSerializedObjectValue(
      this VisualElement element,
      SerializedObject obj,
      Action<SerializedObject> callback = null)
wise dawn
#

pretty sure its that

wispy sage
#

Hello everyone,

Seems like a dumb question, but is there an easy way to send an event to every child of a VisualElement, just like a GeometryChanged event does for exemple.

gusty vapor
#

by doing SendEvent ๐Ÿ˜ƒ

modern cypress
#

Hey, is there a way to localize texts in UI-Toolkit without writing a line of code just like when using Canvas or do I have to load every localized string via code for each text?

gusty estuary
#

unless you are fine with custom solutions

modern cypress
#

Well, I guess I'll have to think a solution to semi-automate it

gusty estuary
small wigeon
#

has there been more info released on how the new binding works?

unborn bluff
#

Is it possible to put gameobjects in front of the UiTk ui? How can I achieve this?

gusty estuary
#

not much changed since then I think

wispy sage
wind gorge
gusty vapor
#

Sadly it's not uitk kekwait

hasty parcel
#

I upgraded to 2023.1 for some new features and it looks like you can't debug events anymore?!

#

I am registering an eventhandler on a parent with size of 0px by 0px. However, it has several position:absolute children and I want to activate an event when any of them are clicked. I have tried quite a few things, but my understanding is that this should work:
target.RegisterCallback<PointerDownEvent>(PointerDownHandler, TrickleDown.TrickleDown);

#

I'm trying to debug where the event is getting to and I can't see the event log window like on 2022

hasty parcel
#

Nevermind! I forgot I changed the picking mode.

last thorn
#

hey guys am I being dim or something, why does "Extract Inlined Styles to New Class" not work for me? I can't see anyone else having this issue and I've just updated Unity

#

e.g I have "Width: 50%" on a UI element, I hit the button, give it a classname, but it doesn't do anything except show the classname below the button. I double click that to make it appear in the Classlist and save, check the USS file and the class name is there but with no properties

#

it just creates the class but doesn't "extract" anything

gusty estuary
#

also, it only extractes inlined

last thorn
tepid gazelle
#

how do you get the textfield to act like a textbox(ie linebreaks)?

gusty estuary
tepid gazelle
#

thanks @gusty estuary

fleet glacier
#

anyone know why my pixel art image that i'm using for my game's icon (project settings default icon) is extremely low resolution once I build?

#

here's the import settings