#๐งฐโui-toolkit
1 messages ยท Page 13 of 1
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
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?
Until it's recommended here, it's not recommended unless you know what you're in for. https://docs.unity3d.com/Manual/UI-system-compare.html
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?
Sounds about right
I would say that there's game that are out using UI toolkit and are working. Just Dance is an exemple.
Yes or you can create custom element to replicate that.
it's all up to you.
In the end you have UI assets, which you can clone like prefabs in uGUI.
And setup scripting with them in any way
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 vapor did you know it's a thing in lts?
yes Image can do vector graphic since ages ago
it's background style
I don't get what type it uses though
I'm guessing they also copied the ScaleMode of Image class now too
Vector Image
it's used in Vector api in uitoolkit
yes
poggie woggie?
want to test something? try import SVG file then on your import settings check if there is an option for VectorImage
or UIToolkit format type.. I forgot what it's called
got any svg at hand?
brah.. google will give you mmillions of SVGs ๐
Browse 39,120 incredible Svg vectors, icons, clipart graphics, and backgrounds for royalty-free download from the creative contributors at Vecteezy!
try get one from there
if you install the Vector Graphic package you can use it in UUItoolkit tho
try it
not in a mood for it atm
yeah, too bad they require us to still install another package for that
I was digging into that before, it's called Background and it doesn't look like you can use it in your own stuff ๐ฆ
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
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
elements are selected via focus
controllers trigger Navigation events which modify focus
if only DropdownField can do datapair and not just string 
time to roll my own I guess ๐ญ
KeyValuePair<TKey,TValue> seems nice on ``DropDownFields`
you can just use index thoug, no?
I'm avoiding indirect binding like that, to goal is to not bloats the project
by bloats I mean, reducing the amount of iterations
you want keyvalue pair and you want to avoid indirect binding ๐ค
we can do delegate as value in keypair
index access not bloating anything
๐ค
you can just write a wrapper for dropdown field which will accept keyvalue pair list
depends on your vs my definition of bloats here ๐
and feed strings to element itself
looking for a re-usable solution, this is for public apis for my work stuffs
so itmust be done nicely
I'd do it with wrapper then
new DropDownFieldWrapper(dropdownElement, keyValuePairs);
and maybe some action callback
for selection
yes something like that, exactly...
Fun fact tho, lots of editor apis in uitk use that workflow... but NOT dropdownfield
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.
What is the selector to change the style of a dropdown's list
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
it's called generic dropdown iirc, so you can use that instead if you want to make a custom ones
Thank you. Can't believe smth so simple turned ot to be so complicated ๐
@gusty vapor I actually managed to change it by adding my USS to the Style Sheets list of the Unity default runtime theme
nice! ๐
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()
Anyone know where the samples referenced here are? https://docs.unity3d.com/2023.1/Documentation/ScriptReference/UIElements.PanelSettings.SetScreenToPanelSpaceFunction.html
MIght only be available in 2023.1
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"?
Looked for it, can't find it there.
Sorry, that was just a guess. It could also be in the sample on the asset store but that one seams like its 2D only
why Clear is much expensive and slower than re-instantiating the whole hierarchy.. I don't get uitk sometimes 
@gusty estuary is SetEnabled doesn't cancel all the events on children?
no idea
it's not disabling element btw
so gotta keep it in mind
apparently it's a confirmed bug..fixed in 2023
what is?
SetEnabled should cancel event propagations
no idea on that
SetEnabled(false) I mean
I mean it's only logical to cancel all events during disabled state
I know, I'm avoiding display flex/none, that thing is expensive... I instead set the opacity on the parent to 0 and STILL looking for a way to cancel all events
I wouldn't want to stop propagation
kekw
well
whatever you are trying to accomplish
is not meant
so just stop
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
it is not... when switching from display flex to none or vice versa, thhe uielement is allocating for a new mesh..including all the children
you should avoid that
imagine.. 1 parent 20 child... flex it, then BOOOMMM... all wasted
test it on 2022+
Pretty sure it was improved
heck
this comment is from almost 3 years ago
usually things stay the same for years in Unity ๐
"We are currently looking" doesn't ring a bell? ๐ค
Hey @gusty estuary is it you that made a MVVM UITK package? Bustedbunny? Looks neat!
I think I just saw something in one of the newest 2023.2 changelogs about that...
yes they fixed it in 2023
Oh i misread.. ithought it was about the SetEnabled one ๐
Oh, was just reading the 2023.2.0a18 changelog. I wonder if tis is like the runtime binding...?
yes they added runtime binding in 2023, which breaks @gusty estuary 's heart with hiis Mvvm toolkit ๐ฅน
Oooh, I literally was just looking yesterday at different runtime options!
eh, whatever
one less repo to manage
kekw
I will have to check it out! Do you happen to know if there is a link to docs?
Knowing it's Unity, don't expect the docs to be available, especially when it's just stated in release notes ๐
to answer to that, I honestly don't know 
All good, I will just look at the source code while I download it ๐
Woooh, they added UxmlSerializedData so you can now serialize ViewData!? ๐ฒ
oh look! they added this new shiny thing! https://forum.unity.com/threads/editor-design-system-spring-update-for-unitys-2022-lts.1445314/
oh shoot, that's the old editor guideline isn't it?
they just updated the content I think 
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?
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
why can't I use binding path for get set properties?
This is one of the reasons to use CaptureMouse() or CapturePointer() but be careful to always ensure you have a corresponding ReleaseMouse() & ReleasePointer(). Once captured the mouse move events will still be captured relative to whatever captured it - e.g. the window in this case.
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
hmm it looks like the serialisation is from https://docs.unity3d.com/2023.2/Documentation/ScriptReference/UnityEngine.PropertiesModule.html
Yeah it is using the new Properties package to handle visiting members
it's not a package, it's internal
Thank you! Works perfectly!
Yeah, now it is shipped with Unity, but it was a seprate package originally. Just not sure how to reference it, "The Properties namespace"?
(I mean, I'm pretty sure it was a package, but I was thinking it was dumped)
Nah, it was moved to being a built-in package
oh they included that now? nice!
Since 2022 (.1 or .2 idk) iirc
hmmm I don't see how you go from an object to the property stuff
What do you mean?
what's the purpose of that property package?
Lets you access properties in a generic way without having to actually access them directly.
any use case?
Binding UI at runtime ๐
uuugh
I think it's if (PropertyBag.TryGetPropertyBagForValue(myObject, out var propertyBag)) { }
basically it's a runtime SerialisedObject
Also could be used for creating game saves i think.
honestly struggling to see any value
why? it's optimized ootb
I probably just don't get the purpose
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
a binding is an data source object, and a https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Unity.Properties.PropertyPath.html
(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
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...
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?
well I assume theirs will have editor support
I am curious what's faster
delegate binding
or their binding
I guess it's on alpha only atm?
it was last updated in 2018 ๐ด
not the package, the internal module
๐ค
(but that's why I thought it was dead)
It was shipped built-in with Unity 2022
huh?
Only 50%. Looks like there is still a need for a MVVM lib, just a lot eaiser to setup binding now
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.
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
Err, right
Does unity provide these kinds of default cursors anywhere?
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
O you mean the icon n not the funtionality haha my bad
I did mean the cursor but taking a look at their implementation cant hurt, thank you!
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!
all new samples use utik
ah I just mustn't have looked at any new ones ๐
@gusty estuary funfact,inlinesStyle cosume lots of memory compared to uss/uxml 
that is mentioned in manual
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
code
X
try it, and prepare to be dissapointed ๐ฅธ
oh I did
back in rimworld days
Imgui took about 40% of frame time
kekw
this is imgui for custom editors, not to be mistaken with the runtime uguii
I only tested them for custom editors
how can I create elements like these to select a component or object or smth?
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
doesnt look to be in uibuilder
You just have to switch the builder to editor authoring mode
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.
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
you could try looking at implementation of Stylesheet SO
but overall it's not supported
so, it's going to be hacky either way
yeah figured
create a visual asset with the styles and check resolved styles?
that's surely a way, but it's definitely not a nice one ๐
you could do at startup and it wouldn't have to even be rendered, seem like it would be the simplest
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
<VisualElement name="colour1" class="colour1" />
Q("colour1").backgroundcolor
or something
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
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
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
instantiate the uxml?
@gusty estuary can we hide certain characters/letters in uitoolkit? are there even richtags for this?
I know, I found nothing regarding this
you can control the opacity hi<alpha=00>dden</alpha>
(or don't include characters in font kekw)
OOHHHHH!!!!
lemme give this a shot!, thanks!
oh did they added this just recently? I'm pretty sure uitk cant do per/mesh manipulation like we'd in TMP
this was added along with the basic richtext support some year or more ago. Control is still basic but colour & alpha are supported along with basic sprite stuff etc.
I use this method for a fake type-writer effect
ahh yeah, this is not per/mesh manipulation like in TMP I think, and it will still occupy the space
but that's fine, I can still use it
yea that's right. It was actually what I wanted in my case - hiding the letters probably just means modifying the string/text
yeah, we can't do this just yet like we'd in TMP.. they're working on it, they said... like they said it from 2 years ago ๐
yea.. slow progress and even when they do, don't expect it in anything <2023 either
there are hidden costs when changing opacity on texts in uitk, at least it used to, worth to check if you rely on it pretty heavily
totally fine for my use case ๐
@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 ๐คฃ
the mystery is easily solved
I was wrong
ofcourse but I prefered not to roll my own due for a fact it was for testing purposes only
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
check the input action configuration file
@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?
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
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
Please help hahaha
try to use fixed height style
until it's your preferred height
If I change the object file height the text is covered by the background of the button
do you have editor theme selected btw?
also, I don't get what you mean
showing uxml will probably help
When you create elements in UI Builder it automatically (ugh) sets the element to flexGrow = 1. Whereas that doesn't happen in code - that might explain the difference - check for overrides of flexgrow in ui builder.
You can also always use the debugger to inspect the difference.
how can i write it like code
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
triple tilda button at first line and last line
On first line you can also specify cs cpp xml for highlights
<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&guid=4a8b337d4f46bb548a9f33550ab4df11&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
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
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
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
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
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
well, thank you very much sir
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
he did just fine with code
he wants it with ui builder (uxml)
but he attached a bunch of styles and it broke layout
oh, my bad ๐
?
yuck, uibuilder ๐คฎ
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
this looks like the element set to flex column..
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

does anyone know how to keep the formatting? custom property drawer for condition and i add a Label and PopupField
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
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?
I honestly don't know that MultiColumnListView exists ๐คฃ .. thanks for the info!
there's an accessor [string] for columns and then for by index for cells (could be wrong, been a while)
Aha, I'll try the index on Column accessor when back at my PC. Thanks for the pointer
Hmm, nope. Sadly there's no accessor for cells or visual elements. Column only offers properties to set cell factory, binding, and destruction delegates.
ah, I see. In that case there is no API to access cells. And that is intended, because any modification to them will not be undone when cells get returned to pool.
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.
they are stateless in a sense, that view controller rebuilds them on it's own
and fully managed their state
it's not exposed to you outside of delegates
Yeah ๐ But that API would suggest "never interact with those view elements" outside of those delegates.
exactly
for all interactions you use related View API instead
which has on click events and etc
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
idk about multicolumn list view
but normal list view uses virtualization
I'd assume they all are like that
That's some good knowhow - render me curious ๐ I'm going to delve deeper into that area.
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
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
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 ๐ 
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
show code for the sendevent you did
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?
make switch ๐
how logic differs though?
maybe you can just keep it branchless
But its allready 300 lines long ๐ญ
and instead modify position based on modifier
What's a modifier?
whatever it is that differs between what position values are
Sorry, I dont quite get it, could you explain it differently? (my english isnt good)
uuugh
instead of
if (negative)
target -= value;
else
target += value;
try to implement logic branchless:
var modifier = negative ? -1f : 1f;
target += value * modifier;
Ohhhh, that would probably be a lot better. Didnt think of that, thank you!
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?
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
using (var ev = NavigationSubmitEvent.GetPooled())
{
button.SendEvent(ev);
}
where button is my UnityEngine.UIElements.Button
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"
or any other alternative to animate a UIElement is welcomed
Yeah
What style do you change?
Not all styles are fully animated
Saw that in the guide aswell, but I tried with position, height and opacity
those should animate all right
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
Specific to instance
That is extremely strange then
Store i as local
C# compiler codegen is playing trick on you here
During the loop, when you print i, it's correct. But it'll continue looping and by the time you click the button, it will have been incremented all the way up. The value you're storing there is the function, which doesn't snapshot i, when you call it it'll use whatever value i ended up as
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?
Show the code where you're adding items
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
What is the type of gripOptions, sightOptions, muzzleOptions?
sorry, its a list
sightMenu.AddOptions(sightOptions);
muzzleMenu.AddOptions(muzzleOptions);```
i then add these lists to their respective dropdown menus
Are you sure that you're using UI Toolkit and this shouldn't be in #๐ฒโui-ux ?
But TMP_Dropdown has a onValueChanged event, use that to listen to the selection and react based on that
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
ask follow up question in #๐ฒโui-ux
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
if you instantiate via UIDocument and you subscribe not in OnEnable - your bindings are disposed when UIDocument is disabled
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
ah! ok thank you
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
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?
whatever fits your use case
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
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
what about timeline profiler?
Which notably wouldn't exist when built with IL2CPP
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?
use TextMeshPro for world space ๐
Unless you require many differing world space positions, I would instead set your panel settings to render to a render texture and then place that render texture eg on a quad somewhere in the world. My guess with the way you have this setup is that it's "scaling the UI in a weird way" probably because it's not changing the scale of them at all when you move the camera.
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
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?
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
Question, how do i work the horizontal layout groups so that all the children like the text, images grow as well.
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
Couldn't you just style the two elements separately in the USS? Not only will this look cleaner but it will allow you to add more classes. Something like this:
.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
pa-group is the base hierarchy, and the want that i want to style when that group hover, and the content border, but here is all the style
https://pastebin.com/Y3ig9Qvq
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@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)
thanks, i will try it
ok here the final
.pa-group:hover > .unity-scroll-view > #unity-content-and-vertical-scroll-container > #unity-content-viewport > #unity-content-container
``` so instead of creating one more Visual Element as Group Content Container, instead im using scroll view content container for that, and its worked as i want....i dont know why...its can target my new created content container
.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
Is there a way to set an elements rect?
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
Hi, can someone help me to make a Visual Element perfectly square for all devices ?
I need to change the scale and position of something but the behaviour when changing style.width changes depnding on what left, right etc are set to (and I dont want it to).
So I thought I could change rect(the one that would be highlit(blue) in ui builder) as that would make everything way easier.
Is there a better way/at all a way to have full control that way?
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
});
here's the formula for aspect ratio https://study.com/learn/lesson/what-is-aspect-ratio.html
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
Hey guys. Does anyone have a link for a tutorial on how to make a slider/carousel on uitoolkit?
I don't think there are many tutorials that specific on UI Toolkit, so that is something you will have to implement yourself
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
Ive done it. Will try to post it somewhere at some time
You are absolutely right
Nice, post an example, I'm sure others would like to see it, myself included ๐
Thanks
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
You could take the base code in the sample and set it to a method in which you could call a custom function that will create more elements
So instead of this:
Func<VisualElement> makeItem = () => new Label();
Have something like this:
Func<VisualElement> makeItem = () =>
{
// build up UI here
}
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?
Why'd you need that?
In that case you would just instantiate those elements within the "makeItem" method. You could even create UXML controls and load them in, so a UI element can be composed of multiple UI elements
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...
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?
Check that Edit/Project Settings/Editor/Inspector>Use IMGUI Default Inspector is not checked (it's at the bottom)
It is not checked
Can you use the UIToolkit debugger and check that the editor is using UIToolkit for that component?
I guess, it does
You need to try to pick the elements in the test component, the inspector root will always be UIToolkit these days
Do you mean this?
What is it? Is it because of NaughtyAttributes?
Yup, they're overriding all MonoBehaviour inspectors, and they don't implement UIToolkit
I think wrapping it with IMGuiContainer would work?
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.
Nothing would stop you as long as it derives from VisualElement
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
Yeah I mean binding to SerializedProperties. The way the ListView does it is by having some special SerializeObjectBinding handler thing that inherits from an internal class...
I love UITk, but boy do they make it hard sometimes...
there's a new-ish example regarding ListView binding via binding property iirc
The issue is I can't do what ListView does for binding, as that is baked in to UITk.
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?
ah I see, yes that makes sense
The way ListView does it is fully internal and is a special case.
what listview does under the hood just have IList to contain the reference for the itemsource iirc
Not for SerializedProperty unfortunatly.
Though they have rewritten ListView like 4 times, so you were probably correct at one point haha
Actually, you might be right...
it is
Yeah you are, but how does it update the size...?
I remember we laughed when we saw it ๐
I sorta forget about this, unfortunately
Oh, found it ...wanna guess... ๐
you can implemment your own ObservableCollection tho... just like what @gusty estuary didd
show me
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
you can easily make your own with ObservableCollection, we did this at work
Gotta work with SerializedProperty. And that feels like an additional layer of code that isn't right for this project I don't think
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)
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 ๐ซก
Haha, well I appreciate your help! Thanks! ๐
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
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
one that's obvious that is TextElement
Uhh, pretty sure it doesn't... they are generating mesh geometry ๐ค
yes they're still in lotta places
you can also see them mentioned lotta times in release notes from past versions
huh
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
Ever since upgrading from 2021 LTS to 2022 LTS my custom fonts won't change color anymore
Anybody else experiencing this?
yeah, I can't really remember why that happened, but only some fonts support rich text
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?
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?
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
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
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
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
Is there something like AdvancedDropdown from IMGUI in UI Toolkit?
DropdownField is not the same, there is no search field
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
hey does anyone know when ui event callbacks are fired relative to the execution order of scripts (Update/LateUpdate) within a given frame?
you can make some Thread.Sleep(10) in a callback and look at profiler's timeline.
That's a good idea
afaik no, but you can always create custom control for its, which if you do only for editor purpose, its nonsense, wasting time...better not unless they provide, since advanced dropdown is already so good, and its work alone, you can right click or any click to show the advanced drop down,
Are you using a package that overrides the editor, like Naughty Attributes?
No i am not
Have tried creating attributes in new projects
is there something like the animator for UI toolkit elements?
there are transition animations
but nothing like animator
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
Resolvedstyle is invalid until it's calculated by UITK, so you're presumably reading from it way too early
so I should wait a frame after instantiating before positioning any element?
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
You're probably supposed to assign it in the inspector
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");
}
}
oh that somehow never cross my mind
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. ๐
canvas?
that's uGUI
not UIToolkit
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
I can show when I am home. Thanks for your help, I try to explain better at home
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.
this also fires on descendants
i am using evt.StopImmediatePropagation(), which should prevent any propagation to other elements.
oh ok, could you explain the difference please?
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
but why is this? according to the docs, this event should only fire once per item: https://docs.unity3d.com/ScriptReference/UIElements.PointerOutEvent.html (it says " This event is sent when a pointer exits an element.").
How could i stop the repeated triggering of the event?
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.
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.
oh
well
what might happen
is that you show tooltip
which triggers leave event because pointer is not over initial element
bro... this could be it... omg
yes this makes sense, i will test this and report back to you
here's my tooltip implementation
lol you even multithreaded this, nice man, looks very clean on first glance ๐
but wouldn't async still start its own worker?
no
i see i confused it then, so async = mainthread (i will keep in mind)
almost none of Unity managed stuff is thread safe
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.
Thank you so much man ๐
It was exactly like you described- the enter event opened the tooltip, which then triggered leave event, which closed the tooltip, then enter triggered again, and so on. What a nasty bug, it had me debugging for 4 hours ๐
I think this might happen because SelectOnVisible.visible isnt emmediately true, is there some kind of event once it is?
I found one but it's still not doing anything
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
I think this is what you're looking for: https://docs.unity3d.com/ScriptReference/UIElements.PanelSettings-sortingOrder.html
The UI Toolkit stuff beeing drawn above the canvas doesnt mean the hitbox stuff is also above it
not really
yeah, input overlap will require hacks to work
or maybe it's easier
but anyway
combining 2 completely different systems is uuugh
Ok I will try to create the old UI from the canvas to the Toolkit as new Design
This channel is for UI Toolkit, and you are looking at canvas, which is UGUI and goes in #๐ฒโui-ux.
However: https://unity.huh.how/graphics/sprites/import-settings
oops, sorry
.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
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.
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?
@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 ๐ฆ
Thanks for information! Sounds good. It was really weird that I need to make almost same .assets files with same content.
How can I disable the interaction with a Toggle for a user? Picking mode ignore doesn't seem to work for Toggles.
make custom class derives from Toggle then override the ExecuteDefaultAction then do evt.StopImmediatePropagation
before 2022 lts the method to override is HandleEvent
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
@gusty vapor thank you!
A couple of options off the top of my head
- when a dropdown is open, toggle the visibility of the button
- move the button into a higher order container so it's drawn behind the dropdowns
- when the dropdown button is clicked, add bottom margin to "contain" all of the dropdown thereby pushing the button to be below the dropdown options
I went with the third option at the end. Was the easiest to do. Thank you
all this can be solved with just absolute position 
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
Does uitoolkit support gif? If not whats the solution?
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
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
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).
IPanel contains API for getting element at specific position
one thing to keep in mind: height values seem to be inverted when you use mouse position from input systems
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
Why can't you just add a click listener to each of your cells?
That I'm already using. It's just...the position where I click isn't the exact correct position in that VisualElement.
Haven't converted to local pos, I'll look into that
y might be inverted as well
You mean with IPointerClickHandler? Or do VisualElements/UI Toolkit have something specific to itself?
That has been corrected, with similar code SlimStv wrote.
element.RegisterCallback<ClickEvent>(evt => {})
don't, if you want to do this, instead add to the parent then get the cells from evt.target instead, muuch cleaner
if((VisualElement)evt.target == cell)
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
another way is to use worldBound and do rect.Contains it may adds another complication depends on your setup, but it's up to you
This is all Klingon to me
Funny thing is, I've tried using the old ways (UI Canvas): same issue
there are runtime helpers if you're using Panel, but can't quite remember which ones
^ 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));
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.
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?
I'm pretty sure that since the uss is display: flex margin collapse isn't a thing
When the game runs, why not just myElement.style.display = DisplayStyle.None;?
Good to know, thanks!
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.
That is a standard Unity control so you can't edit the elements directly. What you can do, is create your own custom stylesheet and target the corresponding elements to style them how you want them. So the low and high buttons have multiple ways of targetting, but .unity-scroller > #unity-low-button would work sufficiently
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.
Thanks so much, it works
And when I want to change the style of the text from the input field, what I need to write? .unity-input-field > ...?
I could do that. I was just hoping for a more automagic solution. I ended up just creating a test uxml file, figuring out what I needed, and then push the changes back to the original.
It depends on which control you are using, but .unity-text-element is what is used for most of the built-in controls I believe. If you are wanting to just target a single control, for example the "Integer" control then yes you can do something like .unity-integer-field TextElement
Yeah, I think the only "automagical" thing you could do is to write your own custom components, but you'd still need a script that will target those elements and hide them
Hi, does anyone know how the ItemsAdded event in UIElements.Listview works? I can't get it to work
ListView questions
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?
ok I was missing an EventSystem because I made my first button in a prefab
yay fixed
This is not UI Toolkit to be clear. It should have been asked in #๐ฒโui-ux (in future)
thanks it works great ๐
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!
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)
pretty sure they fixed this awhile back
Not in 2022.3.3f1 ๐
try changing the pickingMode of the Toggle
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
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
it may or may not, sometimes margin or padding causing some weirdness with the rects
I mean, looking at it in the Debugger
it shouldn't, unless they accidentaly bring back this bug into recent versions... it used to be like this in 2020 iirc
It was in 2022.2 as well, so... ๐คทโโ๏ธ
I posted on the forums, we will see what comes up. I do like that the UITk folks are active on there!
they're on a bug hunting spree since 2022 beta.. like super quickly if you marked your question as BUG ๐
Well I did indeed mark it as a bug, so lets hope haha
if you're using default toggle, proly evt.StopImmediatePropagation
worth a try
Probably, but I am using PropertyField for the content in my actual use, so that would be... less than ideal...
ahh I see
I apprecaite the help!
no biggie, used to be you to help me out lol ๐ kinda weird this time ๐คฃ
proly just for testing purposes, try register a callback manually on the toggle see what will happen
Yeah works fine. And calling StopImProp does indeed stop it as we suspected
Yeah good idea.
Haha yeah, just how it works i guess ๐
does setting font text to % instead of px work? i cant seem to get my text to scale as a percentage
no
but px in text scales
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
that's just not supported atm (at least was back in 2022.2)
but considering px scales
not much lost
what do you mean px scales exactly?
it scales with screen resolution
well
if you set up scaling settings in panel settings ofc
ahh panel settings ok
or just do your ownn math, it's very simple https://study.com/learn/lesson/what-is-aspect-ratio.html
please
if people wanted they'd write their own text renderer ๐
it would be simpler if unity supported it rather than have options that do nothing @gusty vapor
yeah true ๐\
oh boy worldspace is still only planned on the roadmap?
I don't think UITK is really suited for worldspace
z space - sure
but world space - uuugh
"uuugh" thats how i feel about the whole previous ui system before uitk
TMP is good
for world space text ofc
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!
Only show in editor
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?
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)
The Game view is accurate. Just change the resolution or aspect ratios and see where your elements land.
https://docs.unity3d.com/Manual/UIE-Runtime-Panel-Settings.html
Pay attention to "Scale Mode"
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...
its so stupid...
cant set its width, its totally rigid, but this works ๐คฎ
#Popup>TextField>Label{
margin-right: -40%;
}
markup? its not for me
Oh you didnt do an uxml, so try something like this
new Length(20, LengthUnit.Percent)
for the width, not sure tho
idk man, for some reason it is unchangable...
#Popup>TextField>Label{
width: 20%;
}
does not work
I attached a style sheet to that popup btw to see if this changes anything, but nope
nope...
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
look, textField.Q<Label>().style.width = 20; you are querying for a Label
Can you make sure that the TextFiel has a Label child
I already did
also this selector in uss works, so its obv it has a Label Child :V
makes sense
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!
They teach uitoolkit?
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
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
I've heard UI Toolkit is the future as well
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.
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
Thanks! Much appreciated ๐ซถ๐ป
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
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?
are there any free libraries of controls? I need a little progress circle
I might have something for you, I can send it when I get out of bed (ping me in a few hours if I've forgotten)
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?
prefer to use child selector:
.class-a > .class-b
``` , instead of descendant selector:
```css
.class-a .class-b
Ah yes, thank you
But it seems a bit ridiculous that I need 5 styles to modify one component
Hello there! Did anybody meet such problem when property fields are always disabled?
This is full project code (I'm testing on an empty one): https://pastebin.com/DMir50AF
Unity version: 2022.3.4f1
I took code samples from here: https://docs.unity3d.com/ScriptReference/SettingsProvider.html
Funny enough it works in my case and hideFlags not set (2022.3.3f1)
Maybe they fixed it, maybe there's a difference in our setup, are you saving to the project settings folder?
No, I'm not using FilePath attribute, either @wet lance
Either way my workaround works fine and you can use the file path attribute
Code above identical to his
I am on phone and haven't tested their code, I just know the fix works for that scenario
Well it just works without it even with file path attribute ๐
Strange
by default my ScriptableSingleton has HideAndDontSave hideflag
HideAndDontSave = DontSave | NotEditable | HideInHierarchy
Maybe you have to restart for it to occur, it really doesn't matter imo
In my case they are not 
Yeas good point
I've tested without Unity reboot
Yah that's it, it set's flags after reboot
But why didn't you have the flag set in the first place? You had it working before I mean.
Or the case it that the problem occurs only after Unity reboot?
Dunno
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
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
It probably makes sense but it's still way too tricky to find out such behaviour, hehe
@gusty estuary is it possible to force uielement to be resolved this frame?
No idea
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.
Yes, unless it doesn't support something you need (see pin)
you can try calling UIElementsRuntimeUtility.RepaintOverlayPanel
so here is my Editor Window, its use UI Toolkit, and i have 3 question,
- how to get center position of my screen.
- How to get center position of my Editor Window, relative to its position.
- How to get position of my refresh button(the one with blue color, with restart icon) relative to Window Position
thanks in advanced
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?
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.
It's really just toggling a VisualElement.style.display to either DisplayStyle.None or DisplayStyle.Flex which will hide/show whatever "page" you want
It's pretty straightforward, but you're welcome to ask anything you don't understand, that's why we're here
@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? ๐ค
I can't think of anything than just binding property tbfh
hop on to #โ๏ธโeditor-extensions Mech or Navi should be able to answer you ๐
why doeant the heigth change of my UI? i have it on 9% but its still 100%
TIL TrackSerializedObjectValue exists
public static void TrackSerializedObjectValue(
this VisualElement element,
SerializedObject obj,
Action<SerializedObject> callback = null)
flex-grow is set to 1, put it at 0
pretty sure its that
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.
by doing SendEvent ๐
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?
not as of now
unless you are fine with custom solutions
Well, I guess I'll have to think a solution to semi-automate it
Here's my framework which supports it (and much more nice stuff)
https://github.com/bustedbunny/com.bustedbunny.mvvmtoolkit
has there been more info released on how the new binding works?
Is it possible to put gameobjects in front of the UiTk ui? How can I achieve this?
tons of examples in manual
not much changed since then I think
Yes, but you can only send "Unity envents," I would like to create my own :).
Render your object to a texture and display that texture
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
Nevermind! I forgot I changed the picking mode.
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
first you give classname and then you click button
also, it only extractes inlined
Oh! God, I think I need more coffee... Thanks!
how do you get the textfield to act like a textbox(ie linebreaks)?
Doesn't it have a property multiline?
thanks @gusty estuary