#πŸ§°β”ƒui-toolkit

1 messages Β· Page 28 of 1

rough scarab
#

Just dumb things that feel very first implementation

still lantern
#

Ah

#

Have you said anything on the forums? The UITK guys seem relatively active there

rough scarab
#

Yes they didn't reply

still lantern
#

😦

copper solar
#

Suddently I cannot save my style changes. For example I have class .MyLabel, I change the Font asset from default to one for font. Even press ctrl +s to save, but when I click on other class and back again, the font asset is back to default. Any ideas? I deleted Library folder now trying to find what causes it.

#
UnityEngine.UIElements.UIDocument:OnValidate ()```

and this warning comes also. Tho UI works just fine.
copper solar
#

And what is with UI toolkit not saving .uxml files normaly. It saves it on Unity side, but when I check the file it self, it is not updated what so ever. Well some values are updated some not. Which is very weird.

fiery mountain
#

Is there a way to save a visual element directly into a visual tree asset?

#

basically I want to save a visualelement I generate within a script.

stiff talon
#

Is Justify Content enforceable on items in ListView? I tried to change styles for ListView and internal ScrollView, but items still appears at the top of the container instead of the bottom like terminal lines.

cursive escarp
#

Does Q<MyCustomElement>("...") work or does it not support custom elements yet? Getting a null return and I'm positive it's in the UXML πŸ€”

#

oooo for some reason, ui builder isn't saving the rename of my custom element, so that's probably why.

#

yup finds it if I leave the name null in the query. now to figure out why it isn't saving the rename...

cursive escarp
#

yeah, saving a uxml doc in ui builder clears the name of custom elements. seems like a bug.

stiff talon
#

In Scroller element is it possible for unity-base-slider to occupy spaces of high-button and low-button if they are hidden?

copper solar
# stiff talon

You will need to make custom selector for that and edit slider it self. It is 100 % possible, but might need to do some hacking. If you disable by changing Display.None, then you just need to make slider height 100% instead of what it is now. But as I mentioned you will need to create smart selector for that. I suggest using Debug tool in order to select object you want and find his name and etc

stiff talon
#

In my mind buttons shouldn't reserve any space if they are not displayed.

rain pecan
#

Sorry to bother you again, but I have a question related to way 1. I tried it and if I do #HealthBar.unity-progress-bar__progress it does not change anything and it also doesnΒ΄t select the progress bar. Did something similar happen to you?

stiff talon
cursive escarp
copper solar
copper solar
copper solar
stiff talon
real cove
#

no IDragHandler or IBeginDragHandler method does receive or gets called at all

rain pecan
#

Hello, is there a way to navigate through buttons with the arrow keys. I googled and didnt find anything so yeah

glacial quiver
#

implementing a custom inspector with uitoolkit and auto binding seems to save the changes on each key stroke (tested with float and text fields). is this intended behavior?

glacial quiver
rain pecan
#

wait what

#

now im confused

#

ok im stupid

#

sorry

static canyon
glacial quiver
glacial quiver
# rain pecan Hello, is there a way to navigate through buttons with the arrow keys. I googled...

haven't tested this myself but if the focus behavior works at runtime my approach would be to "emulate" a tab key down event like this:

KeyDownEvent tabKeyDownEvent = KeyboardEventBase<KeyDownEvent>.GetPooled('\t', KeyCode.Tab, EventModifiers.None);
yourRootUiDocument.rootVisualElement.SendEvent(tabKeyDownEvent);

you could trigger this logic on arrow key pressed.
but as i said: this approach is untested and feels like a workaround tbh.

wary cloud
#

I have this window done here

#

but in the editor it looks like this

#
using UnityEngine;
using UnityEngine.UIElements;


public class BehaviourTreeEditor : EditorWindow
{
    [MenuItem("SDK/World/Behaviour Tree")]
    public static void ShowExample()
    {
        BehaviourTreeEditor wnd = GetWindow<BehaviourTreeEditor>();
        wnd.titleContent = new GUIContent("BehaviourTreeEditor");
    }

    public void CreateGUI()
    {
        VisualElement root = rootVisualElement;

        var visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/SDK/Behaviour Tree/Editor/BehaviourTreeEditor.uxml");
        root.Add(visualTree.Instantiate());

        var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/SDK/Behaviour Tree/Editor/BehaviourTreeEditor.uss");
        root.styleSheets.Add(styleSheet);
    }
}
#

this is the script

wary cloud
tulip sparrow
#

what am I doing wrong with

slider.style.translate = new Translate(e.localPosition.x, slider.style.translate.value.y.value, slider.style.translate.value.z);

that is causing the slider to stutter? IDK if stutter is the right word tbh

#

the e.localPosition.x isn't jumping around and is accurate

#

is translate not constrained to local?

#

do I need to account for the global position?

#

hmm seem to get it to work switching to pointerMoveEvent.position

#

still kinda confused between using that and localPosition

#

I guess

tulip sparrow
#

do I need to be using translate in geometrychange or something? I think that is what is causing me problems

#

I think because of trickledown and bubbleup that is

#

maybe I just need to register a change event, but still kind of confused on doing that. Since Visual Element implements the callback interface I don't need to do that again right?

#

in a class that inherits from it

tulip sparrow
#

oh derp, I forgot I should be using resolved style I think for this

#

rather, checking the resolved style first

#

okay, nvm, really figured it. I guess according to the docs pointer positions aren't saved or cached, so, doing what I was doing in the way I was doing it was basically causing it to jump between what I'm assuming is whatever value is before, and the new value I want

#

I want to say a null value, or 0, but it didn't do that, so idk

still lantern
#

Is there a good way to setup runtime binding yet?

#

Right now I came up with this, but idk how I feel about it.

public static void BindRuntimeProperty<T>(this BaseField<T> element, Func<T> get, Action<T> set)
{
    element.RegisterValueChangedCallback(evt => set(evt.newValue));
    element.schedule.Execute(() =>
    {
       if (!Equals(element.value, get()))
           element.SetValueWithoutNotify(get());
    }).Every(100);
}
tulip sparrow
still lantern
tulip sparrow
# still lantern What do you mean?

hmm like, I did something like this in my color picker,

        public static ColorPicker Instance(VisualElement accessor, Color color, ColorPickerDelegate method)
        {
            if (instance == null) instance = new ColorPicker(color);
            instance.currentColor = color;
            instance.targetColor = color;
            accessor.RootVisualElement().Add(instance);
            instance.style.display = DisplayStyle.Flex;
            instance.colorPickerNotify += method;
            return instance;
        }

with

        public delegate void ColorPickerDelegate(Color color);
        public ColorPickerDelegate colorPickerNotify;

can do that for your pseudo binding. It is basically what you already did since that is the base of bindings, it's just going straight to it yourself and making one hehe

still lantern
tulip sparrow
# still lantern That is only one way 'binding'.

what do you mean? I was more of thinking doing something as such allows anything to be notified and to essentially be able to pseduo bind? Maybe I don't understanding binding though. I just recently have been able to get back into this after a couple month hiatus, so refreshing myself at same time

still lantern
tulip sparrow
#

but what you have is basically doing that already with action and func, I was just mentioning delegate so if you want to go a step... down? I think it is

still lantern
tulip sparrow
# still lantern I guess I don't understand what you mean then

so what I mean is I subscribe something like

        void UpdateColors()
        {
            if (targetColorContainer != null) targetColorContainer.UpdateTargetColor(targetColor);
            if (redContainer != null) redContainer.UpdateValue(targetColor);
            if (greenContainer != null) greenContainer.UpdateValue(targetColor);
            if (blueContainer != null) blueContainer.UpdateValue(targetColor);
            if (alphaContainer != null) alphaContainer.UpdateValue(targetColor);
        }

to the above delegate lets say, so all these things are update on a value change. So what I was getting at was besides what you are already doing, you just do something like this with any value and any field really.

#

let me see if I can get a more specific route

still lantern
#

So you mean add an event to my data class for when each value is changed?

tulip sparrow
# still lantern So you mean add an event to my data class for when each value is changed?

you don't have to do that. Was just an alternate route, personally, for your question and already using Visual Elements, to be exact what I would probably do is use ChangeEvent<T> already built into visual elements on a method that caches the value in every field I want it to.
For example,

// Event callback
private void OnBoolChangedEvent(ChangeEvent<bool> evt) 
{ 
    // Handling code
}
#

Larger example from the manual if it helps

using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

public class ChangeEventTestWindow : EditorWindow
{
    private Toggle m_MyToggle;

    [MenuItem("Window/UI Toolkit/Change Event Test Window")]
    public static void ShowExample()
    {
        GetWindow<ChangeEventTestWindow>().titleContent = new GUIContent("Change Event Test Window");
    }

    public void CreateGUI()
    {
        // Create a toggle and register callback 
        m_MyToggle = new Toggle("Test Toggle") { name = "My Toggle" };
        m_MyToggle.RegisterValueChangedCallback((evt) => { Debug.Log("Change Event received"); });
        rootVisualElement.Add(m_MyToggle);

        // Create button to toggle the toggle's value
        Button button01 = new Button() { text = "Toggle" };
        button01.clicked += () => 
        {
            m_MyToggle.value = !m_MyToggle.value;
        };
        rootVisualElement.Add(button01);

        // Create button to toggle the toggle's value without triggering a ChangeEvent
        Button button02 = new Button() { text = "Toggle without notification" };
        button02.clicked += () =>
        {
            m_MyToggle.SetValueWithoutNotify(!m_MyToggle.value);
        };
        rootVisualElement.Add(button02);
    }
}
still lantern
#

There is also com.unity.properties

#

I wonder if that is any good...

still lantern
tulip sparrow
still lantern
tulip sparrow
still lantern
tulip sparrow
still lantern
#

Is there a 'hierarchy changed' event for when a VE is added or removed as a child?

still lantern
tulip sparrow
#

I can seem to find a built in controls list, but is there a built in default actions list for a visual element? Trying to make sure I'm not double dipping? an subscribing to events that are already subscribed to?

#

also, is disabling picking mode on visual elements that don't need picking mode beneficial, such as, visual elements holding non changing labels? Just realized I haven't been disabling this on Visual Elements that I haven't really thought about. most just on aboslute visual elements that I don't want to actually interact with but want On Top

#

also, shouldn't

        protected override void ExecuteDefaultAction(EventBase evt)
        {
            Debug.Log(evt);
            //base.ExecuteDefaultAction(evt);
            /*if (evt.eventTypeId == GeometryChangedEvent.TypeId())
            {
                Debug.Log(evt.target);
            }*/
        }

without base prevent defaultactions? It doesn't seem to

terse atlas
#

Hello, using UITK 1.0.0-preview.18 and unity 2020.3.30f1 everything works in editor but I have no UI in build. the log shows this message

#

Any clues on what I'm messing ?

tulip sparrow
#

when I track x and y position in an event for a pointer, it starts from the top left corner. 2DTextures are generated from the bottom left corner. I just solved this by subtracting the pointers yPosition from the height of the 2DTexture, but, was wondering if there was something else already in place that deals with? Like, if I use absolute in the visual element or something?

tulip sparrow
#

so I just changed my pointer to look like this, and I did it with

            pointer.style.backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
            pointer.style.borderLeftWidth = 2;
            pointer.style.borderTopWidth = 2;
            pointer.style.borderRightWidth = 2;
            pointer.style.borderBottomWidth = 2;
            pointer.style.borderTopLeftRadius = 5;
            pointer.style.borderTopRightRadius = 5;
            pointer.style.borderBottomRightRadius = 5;
            pointer.style.borderBottomLeftRadius = 5;
            pointer.style.borderLeftColor = Color.black;
            pointer.style.borderTopColor = Color.black;
            pointer.style.borderRightColor = Color.black;
            pointer.style.borderBottomColor = Color.black;
#

obviously that works, but, made me wonder if that is the ideal route

terse atlas
# terse atlas

OK, made it work, apparently you can't instantiate a prefab that has a UI document to then set the panel settings, and source asset...

tulip sparrow
terse atlas
#

well Instead of instantiating my prefab containing the ui document and then populating I added it to the hierarchy and used Object.FindObjectsOfType<UIDocument>()[0]; to get it and use it and now it works in build so....

tulip sparrow
#

I'm still kinda confused on this, when should I be reading from properties in style vs resolvedstyle vs layout

#

Like right now I'm finding a lot of the things I do I actually do through the GeometryChangedEvent and wondering if that is what I'm suppose to do

#

I'm having a hard time figuring out how to also handle the ExecuteCommand waiting if I try to pass data to a visual element that hasn't had a frame go by yet

#

like, I'm doing things now where I'm caching data that doesn't need to be so that it's there when the gemoetrychangevent happens, but, maybe this is the correct way?

golden reef
#

How would I go about making a vertical layout group I can add and remove images from at runtime?

dusty glade
#

Is it not possible to apply transitions when adding a class to a selector? only for pseudo-class changes?

lavish scarab
#

Been trying to using a unicode from RemixIcon (ttf), and it just comes up as a unknown symbol box :/ (used a unicode viewer to find/double check)

latent inlet
#

hi, I'm trying to crate a custom property drawer with UXML, but I get a "No GUI Implemented" message in inspector

#

I load the UXML file this way

#

AssetDatabase.LoadAssetAtPath<VisualTreeAsset>

#

but I don't understand what to do with it

dusty glade
#

As I understand it you have to override

public override VisualElement CreatePropertyGUI(SerializedProperty property)

and return the resulting root VisualElement. The loaded uxml visual tree acts as the root visual element, so all you have to do is instantiate it, then setup the styles etc and access the serialized properties to bind things.
eg:

public override VisualElement CreatePropertyGUI(SerializedProperty property) {
  var uxmlVisualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("path");
  VisualElement root = uxmlVisualTree.Instantiate();
  return root;
}
tulip sparrow
#

can you use with UIToolkit

#

oops

#

Graphics.DrawTexture

#

I didn't know if that would be better than style.backgroundImage?

#

or is that what it is already doing?

tulip sparrow
#

does style.backgroundImage automatically Reinitialize? Or do I have to take care of that myself

unborn bluff
#

Is it possible to do any kind of animation with ui toolkit?

tulip sparrow
#

Does anyone know if comparing GeometryChangedEvent.newRect.size with ``GeometryChangedEvent.oldRect.sizehas the floating point precision problems and I should useMathf.Approximately` with it?

#

rather, COULD have the problems

dusty glade
#

Sometime toggling/adding classes just never seem to trigger transitions, while pseudo-classes are always fine. I have no clue what could be the issue, this never happens in CSS.

#

TransitionStartEvent never even triggers, are there particular cases in which style changes won't cause transition of properties despite them working fine on pseudo-classes?

tulip sparrow
#

Is it all values added inline to IStyle have to wait a frame to be read, or, is that specific to rect size and position?

#

that being said, what event do I register to outside of GeometryChangedEvent for any IStyle change?

dusty glade
# tulip sparrow Not fully familiar with all of UIToolkit, but, is there an event you should be r...

The style involves a width change.
I have found out transitions will only happen properly if attached to an event.
GeometryChangedEvent will trigger when the width is changed. So far I'm thinking of just registering to it and slightly changing the width or position of the element beforehand to trigger the real width value transition.
I'm wondering if there's a way to manually update the VE and if there's an event associated with VE updates.

tulip sparrow
#

so like, you can register to do an ExecuteCommand I think it is in a value change event

dusty glade
dusty glade
#

Managed to dispatch a synthetized event from a pooled GeometryChangedEvent with proper VE target, the style change registered to this event. The result is the same, it ignores and produces no transition Start events.

dusty glade
#

I've found the issue, it seems that ContextMenu methods that change IStyles won't trigger the TransitionStartEvent, Anything else is fine. Bug?

untold spire
#

Technical artists who are familiar with Unity’s GameObject-based tools and workflows are likely to be comfortable working with GameObjects, Components, and the Scene view.

They might not be comfortable with UI Toolkit’s web-like approach or IMGUI’s pure C# approach.

Internal screaming intensifies

#

It's not really that bad right? Right? 😨

tribal fable
#

It is quite lovely actually

untold spire
#

That sounds nice πŸ™‚

tribal fable
#

UI Toolkit feels very homely if you do front-end web development

untold spire
#

"web-like approach" gave me shell-shock flashbacks to CSS and HTML

tribal fable
#

I mean, you best dust off those skills

#

UXML and USS are basically HTML and CSS respectively

untold spire
#

Just tell me it's not gonna take 17 lines of arcane nonsense to center a div πŸ™

#

With CSS the problem is mostly the need to work on like 900 different platforms in different ways but since this unity stuff is just for unity...

tribal fable
#

No, we don't use divs, we use flex-type stuff

untold spire
#

Whatever the equivalent is πŸ˜›

tribal fable
#

And also, we have a visual editor

untold spire
#

Every time I try to do something that seems like it should be simple in front-end web dev it turns out to actually be this arcane riddle with specific, not-always-intuitive black box answers

#

"Just use this and it works"

tribal fable
#

It is more similar to WPF if you ever tried that

untold spire
#

That's wordpress right?

#

πŸ€”

tribal fable
#

windows presentation forms

untold spire
#

Oh not familiar with that... I guess I'll jump in and see πŸ˜›

tribal fable
#

But, It is much more preferable to Unity's old system for UI, though at this time it is not feature complete

untold spire
#

dayHmm Oh? Is it missing enough that I should hold off on using it?

tribal fable
#

No, it is perfectly servicable

#

what is missing is only for more complex stuff

untold spire
#

It is a GameObject-based UI system that uses Components and the Game View to arrange, position, and style user interfaces.

This sounds so much more pleasant to use I don't know if I can resist the temptation

#

I'm having a lot of trouble wrapping my head around why the cascading style sheets format is warranted for game UIs short of making some menu-heavy 4X game or something

tribal fable
#

I mean the default is pretty servicable for UI

#

The default's for UI Toolkit look better than the defaults for IMGUI, NGL.

untold spire
#

Yeha IMGUI seems like it's mostly for debug type stuff

#

I prefer to try and force myself to learn the newer system... like the new input system is fantastic and way better than the old imo

#

But in this case the newer system is really NOT selling itself to me moon2LOLE

#

Webdev is my kryptonite

tribal fable
#

What I would say is that it is best to sell itself once you open up the editor and quickly debug out a UI

#

And then compare that to the old one.

untold spire
#

Hmmmm yeah I guess I should at least toy around with it a little rather than take my prejudices for granted... dayHmm

#

One thing I noticed on the feature comparison page is that it says it does not yet have integration with the new input system

tribal fable
#

I have trouble selling it similarly to selling the new input system. It is that everything just works once it works.

untold spire
#

Not sure exactly what that means πŸ€”

tribal fable
#

Oh yes, that...

#

So, it uses the old input system on it's backend... which forces you to not only use the new Input System.

#

for 2020.3 at least

untold spire
#

Oh 😐

tribal fable
#

I mean, I imagine that feature will get rolled out very soon.

untold spire
tribal fable
#

Webdev is more programmer friendly

untold spire
#

HTML/CSS aren't programming it's like design/configuring

tribal fable
#

Well, programmer friendly for me, after I built a tool to fix the problems

untold spire
#

When I read this

UI elements in the Canvas are drawn in the same order they appear in the Hierarchy. The first child is drawn first, the second child next, and so on.
I literally pump my fist and go "Yes!"

#

It just seems really intuitive for the use case

tribal fable
#

Again, I ain't good at selling this, the real goal is to apply modern programmer-UI paradigms, which is that the view, the styling, and the code should be seperate.

#

The idea is that you can then rework the view/orientation of how everything is laid out and the styling and code will still work right.

#

you can change the styling and the view and code will work right

#

and you can change the code and the styling and view will work right

#

UI Canvas has a design issue wherein those things are all effected by eachother

untold spire
#

which is that the view, the styling, and the code should be seperate.
Yeah this is pretty much what keeps me out of webdev. I find it super onerous and the premise that you can change one thing without having to change others rarely works out in practice. I know I'm almost certainly not right given the overwhelming support for doing it that way, so I figure the domain just isn't meant for me πŸ˜›

#

Having to swap between the 3 files constantly makes me mental, the infinity of different css tags and their arcane specific interactions... I just want to write code that does things πŸ˜›

tribal fable
#

I think UI Toolkit makes UI a lot more scalable.

#

For small stuff, they are pretty similar.

untold spire
#

Yeah I can start to see the value of that sort of system if we're talking about something really menu heavy

#

Like EVE Online/Elite dangerous or something

#

or a 4X or something... but not like DOOM

tribal fable
#

And also me building tools to make UI Toolkit work

#

I think it is hard to justify if you are dedicated to the New Input System at this time, but one cool thing is that we will get shader support in the future.

untold spire
#

I mean honestly I was ready to just give in and force myself to use it under the assumption that wiser people than I have decided this is the way for a reason... until you told me I'd have to make use of the old input system πŸ˜›

tribal fable
#

Honestly, I am not the best person to sell this to anyone. I just prefer the work style.

untold spire
#

Oh for sure

#

If you are already comfortable with the way web dev works then obviously it's probably delightful

tribal fable
#

well, no, I just really liked WPF when I worked with it and ReactiveUI

#

and when I saw Unity was doing that I was happy.

#

Because ReactiveUI and MVVM (or MVC) is such a great paradigm for making dynamic UI.

untold spire
#

I guess I've never gotten deep enough into UI stuff to start to really appreciate MVC

#

I've worked with quite a lot of different stuff like that but never very deeply as I always retreat back to ... whatever you call non-webdev coding. C# and Java and whatnot πŸ˜›

#

It always just felt to me like every time I changed anything I had to do it in 3 places

tribal fable
#

Generally, I think building out the structure of the application via some Markup Language, choosing how it should be stylized, and then Binding it, is much preferable to carefully laying out Objects, stylizing it as an attachment to the UI, and then selecting C# scripts that may cause breakages if they ever are destroyed.

#

The style system in general allows for me to change every single similar piece of UI all at once instead of individually having to go and do it to every element

#

Or having to write a giant system to do that

untold spire
#

Yeah. It sounds worth dealing with, and since my use case has fairly simple UI requirements it likely wouldn't require sinking too deeply into anyways. But I suppose I'll wait on the input system before I give it a shot

tribal fable
untold spire
#

What exactly do you mean by this

connecting up data

tribal fable
#

Okay, so let's say you click a button, what functions should that button call?

untold spire
#

Go on πŸ€”

#

Or is that no rhetorical? Lol I dunno whatever is subscribed to it

#

Depends on how the buttons work in this context

tribal fable
#

The issue is setting up those subscriptions

#

They required an external tool surrounding the UI to hook up. In my case, I just grab the Button class in scripts and use UniRx to have it call commands.

#
button.BindClick(viewModel.OnButtonClick).AddTo(disposable);```
#

By default, such a system doesn't exist

#

Which means that the UI is mostly static until you make such a system.

#

Now, I am not the only person who made such, there is something called Graphene, but personally, I wanted something with UniRx integration.

untold spire
#

And what is UniRx πŸ€”

tribal fable
#

UniRx is Reactive Extensions for Unity, it basically combines data and callbacks together, so that whenever you change a variable, it emits a signal that it was updated.

#

It is an implementation of the 'Reactive' concept for Unity. It produces some very elegant code, for say, detecting a double click:

            clickStream.Buffer(clickStream.Throttle(TimeSpan.FromMilliseconds(250))).Where(xs => xs.Count >= 2).Subscribe(x =>
            {
                viewModel.OnDoubleClick.Execute(x.Last());
            });```
#

What this code does is it takes an Observable, which is something that will emit a signal when it observes a change in a value, buffers those values over a period of 250 milliseconds, checks that there exists more than two, and then subscribes to execute a function.

#

nywy, I need to go get some sleep, I am working on a new package concept for a 3D Block-Based Tilemap and if I want it to work, I have to bang my head against a wall Tommorrow.

untold spire
#

Thanks for the tips and for entertaining my curiosity πŸ˜›

old gorge
#

Changing it to OnEnable works, but I wonder why CreateGUI is not being called.

tribal void
#

Is it possible to have child selector in USS be relative to parent? f.e. I have a textfield that I am overriding the styles from and I would like the lower level field to inherit the border color and size instead of having to hardcode that in the USS. Is that possible? ```css
.default-text-box {
width: 100%;
font-size: 66px;
border-radius: 20px;
border-left-width: 2px;
border-right-width: 2px;
border-top-width: 2px;
border-bottom-width: 2px;
border-left-color: rgba(205, 205, 205, 255);
border-right-color: rgba(205, 205, 205, 255);
border-top-color: rgba(205, 205, 205, 255);
border-bottom-color: rgba(205, 205, 205, 255);
margin: 0;
padding: 0;
}

.default-text-box > .unity-text-field__input {
border-radius: 18px;
}

#

note that the value is not exactly the same because of padding on the inner element, can I calculate the radius of the second element based on the second? Something like (parent - 2px)

rough scarab
#

You have to hard code everything atm

tribal void
#

Or is it unlikely to happen withing the UITK framework (at least natively, I could just use C# if I really wanted to)

rough scarab
#

They'll be working towards all sorts of common and successful things in web. SASS is certainly one of those

#

It's not close though as far as I've heard

tribal void
#

Alright, I'll keep up hope for it in due time. For now I will just have to work around it

tribal void
#

Is there a problem with the UITK TextField Password property? Every time I save after editing the style of the field and save it just resets to non-password

old gorge
#
<?xml version="1.0" encoding="utf-8"?>
<engine:UXML
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:engine="UnityEngine.UIElements"
    xmlns:editor="UnityEditor.UIElements"
    xsi:noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd"
>

  <VisualElement class="quicktool-button unity-button">      
    <VisualElement class="quicktool-button-icon"/>   
  </VisualElement>
    
</engine:UXML>

Am I understanding this correctly? In the above UXML there is this part: class="quicktool-button unity-button" Is this linking custom USS styles defined with ".quicktool-button" in addition to a built in USS style defined as "unity-button"?

copper solar
#

Is it known bug taht on 2022.1.0b13 and 0b14 you cant press on dropdown buttons? how ever it works, when using debug inspector, but in editor and build it doesn't?

rough scarab
copper solar
#

Thanks. So I guess I just need to wait until it will get fixed? or there is known workaround? As I was forced to work on 2022 on project πŸ˜„

rough scarab
#
field.RegisterCallback<ClickEvent>(evt =>
{
    using KeyDownEvent keyEvent = KeyDownEvent.GetPooled('\0', KeyCode.Return, EventModifiers.None);
    ((DropdownField)evt.target).SendEvent(keyEvent);
});```
#

this is my shitty workaround

copper solar
#

Thank you! work around is an workaround <3, regardless πŸ˜„

rough scarab
#

(it simulates a keypress on it when you click it. Keyboard interaction works fine)

copper solar
#

@rough scarab ❀️ it works flawlessly πŸ™‚

copper solar
#

Any ideas how to change Dropdown font? πŸ˜„

#

tried multiple selectors with no luck.

copper solar
#

nwm I just set default font for everything and it works.. Kinda πŸ˜„

latent inlet
#

hi, is it possible to achieve inheritance in custom editors with UXML? I have a hierarchy of ScriptableObjects, let's say A <--- B (b inherit from A). I have a custom editor for A and now I want to create a custom editor for B but recycling A interface UXML file

#

I'm trying to make BEditor inherit from AEditor, but I'm not sure how to handle this case and if it's supported

summer moth
#

does anyone know why when I create a font asset the file is massive (>2mb), but the ones from Unity are small, like 6kb?

uneven oyster
#

It might depend on the type of font file used as the source

copper solar
rain pecan
#

Hello, does anyone know how i can place a game object in front of the ui?

cursive escarp
#

Hello, has anyone ever integrated a serialized UnityEvent into a custom inspector or editor window using UI Toolkit? And how?

#

need to make custom control? πŸ€”

#

This thing is what I mean

fiery mountain
#

i am trying to use a ObjectField but for some reason none of the objects of with the component types are showing up. I have set the objectType to one of my MonoBehaviors and I see no prefabs with that type of component.

#

I can still drag that type in and it shows the correct type. Just can't select one through the selector menu

heady bobcat
#

Okay I need some serious help

#

I cannot get my buttons to work at all

#

settingsButton.clicked += SettingsButtonPressed;
Leads to the error

#

NullReferenceException: Object reference not set to an instance of an object
MainMenu.Start () (at Assets/UI/MainMenu.cs:47)

#

Nvm found the issue

heady bobcat
#

Okay some actual help needed. I want to call a method ONLY when a slider is adjusted by the player. Is there any way to do so?

#

@wind olive This is uGUI isn't it? I need help with UI Toolkit

wind olive
heady bobcat
#

Lol it's okay

#

I'm having trouble navigate/comprehend the documentation for UI Toolkit

tribal fable
#

I find it strange that a Visual Element does not have an event tied to changing enabled status

#

or even class changing events

uneven oyster
heady bobcat
#

Ty tho

still lantern
#

It was a pain, but I got am event now for when the hierarchy changes! (element added or removed)! πŸ˜„

old gorge
#

Does calling Unbind() on a VisualElement unbind it's children as well?

still lantern
old gorge
#

Ty

#

There seems to be a bug with the UI Toolkit's PropertyField class. It doesn't seem to keep track of the isExpanded value on arrays correctly. It always shows the serialized array as expanded when GUI gets created again even if I manually closed it previously.

#

It doesn't happen when using EditorGUILayout.PropertyField in OnInspectorGUI. Only seems to be a problem with UI Toolkit.

#

At least it is a problem in the version I'm using, 2021.2.10f1

worthy aspen
#

Hey, I'm trying to use the UI Toolkit in the unity runtime and I can't get the mouse events to work. Button.clicked DOES work, but the MouseEnter and MouseLeave events do not.

#

Does anyone know why this might be failing?

tribal fable
#

Make sure nothing is blocking it in scene

worthy aspen
#

OK, so these CAN be blocked.

#

OK, that was it, it was just being covered by stuff.

#

Thanks @tribal fable

abstract rock
#

Question, I need to put a TMP file inside a script for a text file I believe

#

So the tutorial said "make a text, put it in that spot in the script"

#

but I have textmeshpro installed, and I cna only create a textmeshpro now, and the script doesn't want to take that kinda object

grizzled kindle
#

there seems to be a lack of documentation on how to actually use the input system with ui toolkit

#

i have a dynamically populated list view and want to navigate that (up, down, enter) with both kb/m and gamepad

#

how would i do that?

glacial verge
#

I would index all of the buttons in a particular menu and have the up/down on kb m or gamepad iterate through them

#

starting at 0

uneven oyster
#

the important interaction between the input system and the UI system is the input module on the event system

spark cove
#

Hello guys, do anyone know the simplest way to do this? I need to have panel that is dark and transparent and second object where dark panel will not affect it. On that way I will be able to highlight some specific objects in UI. Do anyone know the simplest way or some asset on the store?

unborn bluff
#

I have the Problem in the Ui Tookit that i hide and show panals. First it works and if i disable it and make it visible nothing happend. It shows the panal not again. what is happend ?

worthy aspen
#

This leaves pointers intact, and does not regenerate the tree.

unborn bluff
worthy aspen
static canyon
#

el.style.display = DisplayStyle.None; (to show: DisplayStyle.Flex) is what we use and I believe the recommended way to optimally toggle "visibility" of elements. Opacity => 0 (or visibility I think) can be used if you want to maintain the same layout as if the element was there, just not render it. In practice I've rarely seen a need for it though.

stone urchin
#

So i discovered this exist by accident today and wanted to learn it, any up to date tutorial available?

gusty vapor
#

how can I set a button selected state programmatically, with just c#?

#

I see pseudoclass in the docs, but not quite sure how to adapt that

tulip sparrow
#

does anyone know if comparing if (e.newRect.size != e.oldRect.size) I should use some sort of approximate instead?

wise heron
#

hi, I try to use a Slider(Int) in my new UI and i cant find, where i can change the size of the slider. And is it possible to add a field where you can see the current value of the slider?

tulip sparrow
#

is there a way to use absolute positioning when uhh doing a position check compared to a texture? I just have to keep doing something like

float yConversion = Mathf.Clamp(saturationContainer.layout.height - saturationPointerY, 0.0f, saturationContainer.layout.height - 1);

in several areas

#

oh, and that is from the PointerMoveEvent.localPosition

#

I guess I could just make a static function, but, I didn't know if there was something already in the events I'm missing

tulip sparrow
#

do any of you know if doing pickingMode = PickingMode.Ignore; on an element that you don't plan on doing anything that involves picking mode is more efficient than not doing it?

#

and also if that is something that inherited, so if I have a parent with that enabled, if I need to disable it on a child

rough scarab
#

It's not inherited, and yes, I would do it on anything you don't want clicked personally

pale comet
#

Is UI Toolkit going to support shaders, 3D models and such?

#

So far, the only examples I've seen are for minimalist-styled UI

mellow hull
#

Which doesnt tell us much.. Could be next week, or in 5 years.

fiery mountain
#

out of curiosity. Are spite atlases used by the ui toolkit? Just wondering what's the optimal way to use sprites? I was having issues when assets weren't located in resources (maybe just a bug)

#

i'll be using a mix of sprites that will be part of a build but i'll also have some swapped at runtime

tulip sparrow
fiery mountain
tepid knot
#

How can I get and change VisualElementFocusRing.defaultFocusOrder?

zinc snow
#

Hi pals
How can I link a nice USS stylesheet to a Button (or any other) object created with Unity UI ?
I got a nice base AI that I need to pimp up a bit

Considering it needs to be simple to modify and maintain even after I leave the team, I need it to be with something as simple as USS style sheet

Thanks !

wraith ibex
#

i didnt even know tthat existed lol

zinc snow
wraith ibex
#

yeah im readig

#

when did this come up??

zinc snow
#

I don't think U can use CSS in Unity (would be amazing)

#

uuuh pretty recently I think

wraith ibex
#

i saw a plugin once in assetstore but never tried

#

for css i mean

zinc snow
#

oh I'm gonna look for that

#

Yeah nah
it's better to use USS

wraith ibex
#

probably

#

i didnt even know this existed

zinc snow
#

it seems amazing but I fail to find anything really useful

rough scarab
#

Unity UI (UGUI) is a completely separate system than UI Toolkit. USS is not designed for it, and I doubt anyone would have made anything handle it, as it's not designed to use it, and is an in-progress replacement. UGUI's styling is done via prefabs, or direct code modifications.

zinc snow
merry blade
#

Is it possible to create instances of a UI Document? I would like to create 2 (or more) separate versions of my overlay UI

tulip sparrow
#

is it possible to stop ExecuteDefaultAction without inheriting from VisualElement? Can I do it somehow on a VisualElement field?

#

I guess I could just make a new VisualElement container that inherits from it, and then make the override public idk

hollow jacinth
#

Is it possible to mix UGUI and UI Toolkit?

tulip sparrow
hollow jacinth
#

I'd like to use a file browser asset that uses UGUI, but I use UI Toolkit in my game

#

So that might work?

tulip sparrow
#

What do you guys think about with a helper/utility class for UIToolkit? Originally what I have been doing was in a lot of my classes at the bottom I have an initializeUI type function that uses UIToolkit to display info I want to display in that class. I want to remove that further and do something like

public static class ExampleClassUIToolkitDisplay
{
  public static VisualElement Display(this ExampleClass)
  {
    //code
    return visualElement;
  }
}

However, IDK if this is a good route to go?

hollow jacinth
#

It depends on how you want to organize your stuff. I have non-static classes derived from VisualElement, and I pass a reference to the thing I want to display in the constructor.

tulip sparrow
hollow jacinth
#

Talking about runtime

#

Editor has its own file browser stuff that works

tulip sparrow
#

ohh, I believe you can technically use either or, but, I don't know which one would take priority for display, however, UIToolkit has a container for UGUI

#

I'm trying to find the exact thing for it for you

hollow jacinth
#

I haven't been able to find it in the manual, but that's not surprising

tulip sparrow
#

so let me see

hollow jacinth
#

I think it's only IMGUI, but it seems to be possible to combine them

#

Seems I can just use both, and set the sort order to display UGUI on top

#

I have zero experience with UGUI, but I guess I can just try

tulip sparrow
#

I'm sorry I can't be of more help, a while ago I started learning UIToolkit and kinda stopped looking at all the other UI tools

hollow jacinth
#

Thanks anyway!

#

Your approach of using extension methods for display sounds fine btw, if you want to separate the UI code out of the game logic

#

If you want to go further you can also define interfaces for your game objects and use the interfaces as arguments to the display method, that way you can use the same display function for different game object classes.

#

But you can also just do that for those things where you need it

#

Like you have enemy : ICreature and ally : ICreature, and then Display(ICreature)

#

And ICreature has just the stuff you need for display

tulip sparrow
#

Okay cool. I was mostly thinking about if I ever used something like UGUI or IMGUI I could split away from having code for UIToolkit, if that makes sense

#

so was trying to think of a route to go for that

hollow jacinth
#

IMGUI isn't for runtime afaik

tulip sparrow
#

so like, I've been making a custom color picker in UIToolkit, but want to still keep the core parts of the color picker still in tact

#

yeah, but I mean more than that, like, if I ever want to try and implement this color picker another program or something

hollow jacinth
#

Yeah it makes sense to have the logic separate from the display

#

Loose coupling and all that

tulip sparrow
#

idk, but I'm also doing this to learn more about uhh what's it called, to teach myself to better make classes not rely on other classes?

hollow jacinth
#

If you want to read how the pros do it, look up MVC

tulip sparrow
#

I forgot the word atm lol brain fart

#

oh yeah coupling I think is it

hollow jacinth
#

MVC is just one way to split off the display from the logic

#

But it's a very frequently used one

#

I'm doing just model and view though, with controller stuff sitting in the model class

tulip sparrow
#

@hollow jacinth I think instead I decided to make a non static class, and just have a null field of just some helper class till it doesn't need to be null anymore

#

just the way I'm setting this up I don't think I want to have a bunch of static fields just hanging around

hollow jacinth
#

Why static fields? Static classes aren't a problem, static fields can be (according to every code smell analyzer)

tulip sparrow
hollow jacinth
#

Yes they do, but you probably don't really need any fields in that class

#

Unless you want to have some general parameters to control how something is displayed

#

In which case the problem is you have to remember to set those before you start building your UI

tulip sparrow
#

even though for some reason the UIToolkit page says you can't do this, I do

#

so idk why it does

hollow jacinth
#

Then you might want to just derive a class from VisualElement

#

It wont be static that way, but you can just use a constructor to pass in a reference

tulip sparrow
hollow jacinth
#

Yeah, but also probably public ColorPickerUIToolkit(VisualElement parent, ColorPicker picker)

#

You have to put in the reference to the thing you want to display somehow

tulip sparrow
hollow jacinth
#

Ah, okay

tulip sparrow
#

so static ColorPicker instance;

hollow jacinth
#

Well, I got to go

tulip sparrow
#

okay, have a good one

hollow jacinth
#

You too!

merry blade
#

Is there some way to make my UI Document inherit position from parent?

#

I have a UI panel overlay on each of my game board prefabs, and I've got 2 of them (game boards) in the scene, in different positions, but both UI panels are in the same spot

pearl hamlet
#

Is there any documentation on the included tabbedview and tabbutton scripts? I would like to have tabs in my UI

hollow jacinth
#

If you want to have the panels in screen space, you can have a visualelement in there that you set to the position (and size) you want with position : absolute, then just put your stuff into that visualelement

#

You will have to keep it synced with your game objects' positions somehow though

#

Using world space UI sounds like a better idea if you can get it to work

rich sail
#

Sometimes my canvas ui elements delete onclick and other times they dont
anyone know the problem?
I do have a custom cursor

grizzled kindle
#

can someone explain the difference between the following?

#

what i want is for the ListView items to be aligned in the center, but at the bottom of the screen

#

for some reason, setting "Align Items" to Center breaks the layout and i can't figure out why

tulip sparrow
#

I'm not sure the best way to approach this error Invalid width (0) or height (0) used for creating mipmaps. which is triggering from

        void OnGeometryChangedEvent(GeometryChangedEvent e)
        {
            if (e.newRect.size != e.oldRect.size)
            {
                draggerBackground.Reinitialize((int)draggerContainer.layout.width, (int)draggerContainer.layout.height);
                draggerBackground.Apply();
            }
            UpdateDragger();
            UpdateInput();
        }

which is from

        public void Close()
        {
            style.display = DisplayStyle.None;
        }
#

the DisplayStyle.None is happening on a parent visual element, so didn't know if I should just track the parents visibility or

#

maybe I should have all events unsubscribed from when it closes? hmm

#

I was thinking that it wouldn't have mattered since the parent isn't visible

#

well guess I could probably also just do if (e.newRect.size != e.oldRect.size && e.newRect.size != new Vector2(0.0f, 0.0f)) but IDK if that is a correct route?

lethal lotus
#

Hi folks! I'm using the new UI Builder and I've added a slider. I managed to customize the look by using USS, but I can't figure out how I can set the color of the filled slider. Eg:
The left hand side of the slider should be a different color because the value is selected

grizzled kindle
#

what happened πŸ€”

cursive escarp
# grizzled kindle what happened πŸ€”

Referring to my deleted messages? Felt it was unfair to complain about ListView without offering how I think it could be improved. Going to try using binding path to see how much binding could be done automatically vs binding each prop like I was doing before. Could be that I'm just not using that to it's fullest potential.

tulip sparrow
#

instead of just trying to 0 out a value I should use the StyleKeyword.Null correct?

#

as an example

                if (value == SliderDirection.Horizontal)
                {
                    container.style.flexDirection = FlexDirection.Row;
                    dragger.style.top = -2;
                    dragger.style.bottom = -2;
                    dragger.style.left = StyleKeyword.Null;
                    dragger.style.right = StyleKeyword.Null;
                }
                if (value == SliderDirection.Vertical)
                {
                    container.style.flexDirection = FlexDirection.Column;
                    dragger.style.left = -2;
                    dragger.style.right = -2;
                    dragger.style.top = StyleKeyword.Null;
                    dragger.style.bottom = StyleKeyword.Null;
                }
fiery mountain
#

I have a problem with a canvas blocking my ui builder button. Is there a way for the ui toolkit to intercept the click events before the legacy ui?

#

biggest issue i suppose is that the legacy was set to overlay.

tribal void
#

How do I define multiple RadioButtons to be in different groups? I have 5 radio buttons on a single screen but there should only be an interaction between 3 and the other 2 not all 5 at once

#

if I click on any of the 5 radio buttons, it disables the other ones

tulip sparrow
#

I'm still somewhat confused if someone could help. We have layout values we can read from, and resolvedStyle values. Obviously, these both produce different things, but, can also produce the same thing. Is there any difference between one of them I should prioritize reading from if both can provide the same answer? For example, layout.width and resolvedStyle.width

tribal void
#

you should listen for the style resolved event before reading the value tho

tulip sparrow
#

wondering if I can get help with I'm possibly doing wrong here?

if (sliderDirection == SliderDirection.Horizontal) dragger.style.translate = new Translate(draggerContainer.layout.width * (value / maxValue) - (dragger.layout.width / 2), 0, 0);

Just noticed that my max doesn't seem to be lining up correct, though I have the input field with the correct value, I guess I could have something else wrong, just assuming this section

tulip sparrow
#

wondering if some floating point precision is happening and I need to clamp that also

cursive escarp
#

I have a very large, deeply-nested object that I'm trying to write an editor for. Essentially, one SerializedObject with a ton of SerializedProperties. But I don't want to write my editor in that way. I can't control the underlying data model, but I want to split up the editor in sensible ways. To do that, I've tried to wrap my UXML docs in a BindableElement, so that I can bind properties to the root of the UXML docs. It was my understanding that setting the children binding path's would propagate the relative properties of the root property to the child elements. Is this wrong?

#

Simple example:

public class Item{public string name;}
public class ItemContainer{public Item item;}

UXML:
BindableElement (no pre-set binding path)
-> Label (bindingPath: name)

Binding code:

public class ItemUI : EditorWindow{
public SerializedProperty serializedItem{get;set;}
...
rootVisualElement.Q<BindableElement>().BindProperty(serializedItem)
}

public class ItemContainerUI : EditorWindow{
public SerializedObject serializedItemContainer{get;set;}
private ItemUI itemUI;
...
itemUI.serializedItem = serializedItemContainer.FindProperty("item");
}
tepid knot
#
UnityEditor.UIElements.Debugger.MatchedRulesExtractor.<FindStyleSheets>g__RecursivePrintStyleSheetNames|4_0 (UnityEngine.UIElements.StyleSheet importedSheet,```
Have you ever encountered that error after opening UI Builder?
tulip sparrow
#

what is the best way to limit a flex direction from flex grow? I have a container I want to grow to the height of the elements in it, but not past that. Do I just alter the maxHeight property or is there another way?

#

also, if using flex grow, is there a way to limit the expansion to be a 1:1 ratio with the other axis?

tulip sparrow
#

oh, I guess I don't want to use flexGrow if I want it to be the size of the children?

sleek iron
#

Hi! Aside from the documentation, does anyone here have a resource they particularly enjoyed for getting started with UI Toolkit? Thank you.

tulip sparrow
tulip sparrow
#

what would be the easiest way for me to rotate text so it is displayed vertically? And not vertically as in each letter wrapped on top of each other. Just rotate the entire textElement? Didn't know if there was something already implemented if so, and/or the name of this thing

#

just messing with label.style.rotate = new Rotate(-90); atm

tulip sparrow
#

I've been setting up some classes with properties that already exist on visual elements just to make my life easier reading through the IDE tips sometimes, anyways, I setup a property to look something like

        public FlexDirection ContainerFlexDirection
        {
            get {return container.resolvedStyle.flexDirection;}
            set {container.style.flexDirection = value;}
        }

and made me wonder if any instance where I would want to read a value before the layout pass and that something like this won't work?

ancient turtle
#

how do i get my text to appear on top?

tulip sparrow
#

here are commands you can use that already exist

To change the drawing order of visual elements, use the following functions:

BringToFront()
SendToBack()
For sibling visual elements, use the following:

PlaceBehind()
PlaceInFront()

#

changing an elements position to Absolute will also put the element on top, but, this changes many different other things also

#

Unity recommends not to use Absolute, unless using it as an "overlay" of sorts. Although I do agree with it, I also do love using absolute, but maybe not for good reasons. Absolute is what I use to essentially force an element in a position if I don't current know how to make that position work through relative hehe

grizzled kindle
#

any ideas?

tulip sparrow
#

Inline styles take priority over things like stylesheets... EXCEPT, when you use StyleKeyword.Null; I guess? Which results in me doing x.labelElement.style.minWidth = 0; instead of x.labelElement.style.minWidth = StyleKeyword.Null; or one of the other StyleKeywords since those work also. Any quick ideas on creating a basic VisualElement into things like my own TextField? I have an extension method for example, called ResetAll() that basically nulls out all default values set in a style so that I can better edit the native elements Unity has created, but, because of the above example, it just becomes a nuisance at times

#

I can also just disable that label element and make my own and add it as a child of the TextField container, but, that seems like a mess that although no one would notice, would still drive me nuts

wise heron
#

hi all, have some one a hint for the best practice to show and hid a e.g. window or popup in Ui-Toolkit? Activate or Deactivate the UIDocument GameObeject or the the visibility of a VisualElement or something different?

hybrid galleon
# wise heron hi all, have some one a hint for the best practice to show and hid a e.g. window...

Not sure about best practice, but afaik you can set the root visual element's Display style variable to Display.None. That should hide the whole panel.

I had some issues with this earlier, where some child text elements were showing up randomly despite the parent being set to Display.None. In that case setting the root element's opacity to 0 did the trick. Probably not the intended best practice though.

cursive escarp
#

Is it possible to register a callback to trigger once a visual element is bound? need to update layout once I have the initial value and RegisterValueChangeCallback doesn't seem to fire on initial set.

hybrid galleon
#

.

For those who have any idea: How do you detect UI Toolkit elements with raycasts, like the Graphic Raycaster system in UGUI?

I'm trying to make an inventory system with a large visual element (an item pickup) that follows the cursor. Whenever the edge of this item pickup touches a visual element in the background (a 'slot') the slot needs to light up. The mouse isn't necessarily directly over the slot at that point though, which is why I need a raycast along points at the edge of the item pickup rect to detect the slot overlapping. Is this a valid approach, and how can you do this using UI Toolkit?

hybrid galleon
cursive escarp
#

or you could subclass the VisualElement and override its Overlaps method.

#
public class Slot : VisualElement{
...
override Overlaps(Rect rect){
//light up
}
}
hybrid galleon
#

Thanks a lot for pointing out the docs reference

cursive escarp
#

Is there anyway to get the SerializedProperty an IBindable is bound to?

tulip sparrow
#

Is there any reason if creating my own data containers for VisualElement things, that, I would benefit more from lets say, caching a float as a float vs just using StyleFloat

grizzled kindle
#

is there somewhere i can find the source code for UIElements' ListView?

#

i'm interested in where bindItem is called

grizzled kindle
#

ah thanks

tulip sparrow
#

I just realized I'm kinda confused between Auto and Null. If the value is null, isn't the default auto? For example, Align.Auto says

Let Flex decide.
But, if the value is Null... isn't that what it is already doing?

tacit forum
tulip sparrow
#

if I dynamically change it

tulip sparrow
#

are the default values for IStyle set through the interface itself, or, the VisualElement? I'm trying to figure out if I wanted to have a clean IStyle if it would be easier to just set a new IStyle, or, to set all the values to StyleKeyword.Null

#

I guess I could inherit the Interface also, which would give it priority when the visual element does it's initialization right?

#

Then I could set all the values that way

grizzled kindle
#

does anyone know how NavigationSubmitEvent or NavigationCancelEvent work?

#

i want my own event to not have to manually load and enable an action map

pearl hamlet
#

how do I use a ListView?

#

I've got a this:

void onRenderPlayerInventory()
    {
        ListView InventoryList = rootElement.Q<ListView>("ItemsList");

        Func<VisualElement> makeItem = () =>
        {
            VisualElement temp = new VisualElement();

            Label itemName = new Label(); //add item name
            itemName.AddToClassList("InventoryItem");
            temp.Add(itemName);

            return temp;
        };

        Action<VisualElement, int> bindItem = (e, i) =>
        {
            e.Q<Label>("InventoryItem").text = PlayerInventory.pInventory.inventory[i].name;
        };

        InventoryList = new ListView(PlayerInventory.pInventory.inventory, 32, makeItem, bindItem); //add element
        InventoryList.AddToClassList("ItemsList");
    }

but nothing is happening, and I can't add anything manually, either.

fluid magnet
#

anyone ran into an issue where the UI Toolkit slider resets to 0 everytime you click on it?

#
  • Just figured it out, the slider was moving outside of it's element box lol
tulip sparrow
#

I'm trying to reduce the amount of VisualElements I have being used for different things, and, instead doing something like

    public enum ContainerOptions
    {
        None = 0,
        Draggable = 1
    }

for example, and, if an option is selected, to instead just alter different events one individual visual element is using. My question is, how I can approach this. I have Draggable draggable; for example as a separate field and set it with something like public void SetDraggable(bool isDraggable, DraggableOptions options = DraggableOptions.None), so that I'm not having the container double down? on events through the default actions and registering to them. Should I just have a method in my public class VisualContainer : VisualElement that adds to the default actions?

tulip sparrow
# still lantern What about a Manipulator?

yeah, I was just reading more about manipulators, though I kinda scrapped what I was trying to do for now and just put all the draggable code into the main visual element and just toggling it

obsidian jungle
#

anyone know a way to force dark theme in UXML? I have a single editor with 15 tabs of information, don't really wanna redesign a whole new set of CSS for light-mode (at this time)

#

also, is there a better way to use a dropdown to navigate list items than how I've done it here (fake sort of binding)?

wicked wing
#

Why does it not hide my menu when I set the root visual element visible to false?? It worked and then just randomly stopped working. How can I fix this??

latent inlet
#

hi, what is the correct way to handle TemplateContainers?

#

I am in the situation I need to add styles to template containers because they "broke" the styling

obsidian jungle
#

@latent inlet I understand TemplateContainers to basically be "your UXML File" yeah? What's wrong with yours that it needs to be restyled? (personally, I found dropdownfields came with a margin-left for some reason so have used USS to make those VERBOTEN!!!!)

tulip sparrow
#

Yeah, unfortunately IDK anything about the templateContainers. Since I do all my UIToolkit things specifically in C# I don't actually know anything about the UXML and USS files lol

obsidian jungle
#

In general though, I find TemplateContainers don't really have disruptive styling. They just behave a lot like one default VisualElement. So, curious what is making their thing break... or define "broke" lol (without referencing my bank account)

pearl hamlet
# obsidian jungle <@199046815847415818> rw has a good tutorial that makes use of listView, he shar...

hmm, I tried replicating this with the following:

ListView list = rootElement.Q<ListView>("InventoryListView");
        list.Clear();

        foreach (InventoryItemInstance item in PlayerInventory.pInventory.inventory)
        {
            print(item.name);
            VisualElement iRoot = new VisualElement();
            iRoot.name = "Item";
            Label iLabel = new Label(item.name);

            iRoot.Add(iLabel);
            list.Insert(list.childCount, iRoot);
            print(list.childCount);
        }

but list.Insert does nothing. childCount is still 0.

obsidian jungle
#

I believe ListViews are special in that they attempt to hide the many layers of complexity when you're using them

#

dig deeper into the hierarchy there. There should be a content box

#

for example, here is my full scrollview hierarchy

#

and even when i drag objects onto scr-standard-abilities it automatically dumps them into unity-content-container for me

#

i know list views are a little different though.... i think they have to be bound to a List<T> in order to work?

rough scarab
#

You're not intended to manually manage the children of a list view, it's done via the list view functions

obsidian jungle
#

maybe a ScrollView is what you're after lol, you can manually add to those

#

meanwhile... ListView is what I need.... ScrollViews are placeholder for now so i could visualize and prepare the childelements easier

rough scarab
#

A ListView requires setting the source, how you make items, how you bind them, and unbind them. Because it only shows what's on-screen and just rebinds items in its own internal pool

pearl hamlet
obsidian jungle
#

i am actually struggling to see from the tutorial i sent, where that binding is actually happening tho

tulip sparrow
#

Alternatively, you could also just do something like

        void InitializeFoldout(string labelText)
        {
            foldout = new Foldout();
            container.Add(foldout);
            foldout.value = false;
            foldout.text = labelText;
        }

        public void AddItem(VisualElement item)
        {
            foldout.Add(item);
        }

and make your own list

#

little more complex than that, but yeah

pearl hamlet
#

Scroll view seems to be working fine for me (read: I can add items in the UI builder) but I want things to be able to be selectable

pearl hamlet
pearl hamlet
obsidian jungle
#

think so, yeah

pearl hamlet
#

yes, I can. That's good enough.

obsidian jungle
#

just tried with a red VisualElement in my CustomInspector

#
ve.RegisterCallback<ClickEvent>(TestClick, TrickleDown.TrickleDown);
#

works good

pearl hamlet
#

how exactly do templates work?

rough scarab
#

They're just a UXML tree that you can clone, creating that as Visual Elements

spice walrus
#

what is the status of ui-toolkits gamepad support?

obsidian jungle
#

@pearl hamlet I'm still new and figuring it out, but I am going with the full UXML/USS/CS worfklow and currently understand TemplateContainer to be just a regular old VisualElement, the only difference being that it's called "TemplateContainer". Unless you're asking LITERALLY how does it work, like "how is it implemented?"

#

in which case, here you can see my UXML/USS/CS file, for a custom inspector on my Test class

#

my uxml references the USS file and dropdown

#

in my editor script, i add my xml file to the inspectorGUI. VisualTree is the UXML asset itself, whereas my ui variable stores the TemplateContainer that comes from it, which is what the VisualTree becomes onces its inserted into the GUI

#

and BAM.... that's how you make a simple dropdown in only 5000 easy steps

#

#worthIt

pearl hamlet
#

so my next step is to create a Book system, where each book in the files is either
a) one UXML document that somehow has different Pages (which would be easier to work with) or
b) a set of Pages, each as UXML files (easier to implement I suspect)
and then these pages are then slotted into a general book screen that has page turning buttons.
How would I go about accomplishing this

#

can I add an entire UXML tree into a document from the script?

pearl hamlet
obsidian jungle
#

yeah you can load millions in if u want

#

you can even clone the same UXML a zillion times

pearl hamlet
obsidian jungle
#

you can just run the above code snippet many many times lol

#

it will keep adding the same UXML, converting it to a TemplateContainer for your gui, and adding it to your UI

rough scarab
#

You can serialize a VisualTreeAsset, and call CloneTree on it, then you get a TemplateContainer, which is the VisualElement you can then use.

obsidian jungle
#

i mean... i SHOULDN'T... but i COULD.... do this:

#

or uh.....

tribal fable
tulip sparrow
#

I feel like I might have been going through some of my custom UI all wrong... Not that it doesn't work, but, that, I could make my life easier. If I have public class VisualContainer : VisualElement what is the best way you think to go about "overriding" default style options? Originally, I was having things split into categories, and then set in the constructor. I didn't know if there was a better route? Some people got me thinking yesterday maybe I should just make a DefaulValues abstract class maybe, have it inherit from VisualElement, IStyle and then have my base custom container inherit from that?

#

Obviously I can inherit from IStyle in my base, but, I was thinking of this way to help alleviate the long list of IStyle interface that would show up

#

I was looking at using public new IStyle style; but, wasn't sure how I should go about setting the values in this way

#

I guess I could do something like this for the entirety of style

    public class Borders
    {
        public StyleColor borderBottomColor = Color.black;
        public StyleLength borderBottomLeftRadius = 0.0f;
        public StyleLength borderBottomRightRadius = 0.0f;
        public StyleFloat borderBottomWidth = 1.0f;
        public StyleColor borderLeftColor = Color.black;
        public StyleFloat borderLeftWidth = 1.0f;
        public StyleColor borderRightColor = Color.black;
        public StyleFloat borderRightWidth = 1.0f;
        public StyleColor borderTopColor = Color.black;
        public StyleLength borderTopLeftRadius = 0.0f;
        public StyleLength borderTopRightRadius = 0.0f;
        public StyleFloat borderTopWidth = 1.0f;
    }
cobalt cradle
#

What's the equivalent to Repaint() in UI Toolkit? I tried using rootVisualElement.MarkDirtyRepaint(); but it's not working.

tulip sparrow
# cobalt cradle What's the equivalent to `Repaint()` in UI Toolkit? I tried using `rootVisualEle...

What exactly are you trying to do? A lot of UIToolkit changes take effect after the next frame, so, for example, if you change things in layout, and want to do something right after, people usually subscribe to GeometryChangedEvent. Not saying this is what you need, but, it's why I'm asking what you are trying to do exactly, since your question is usually asked out of relevancy with the above info.

#

can also look into using ChangeEvent

cobalt cradle
tulip sparrow
#

I don't think there is a repaint that defaults the entire editor?

cobalt cradle
# tulip sparrow sorry, that is still kinda broad... hehe, for example, `Editor.Repaint` is only ...

This is an Editor window that deletes a folder from a specified location. When I was using the legacy system, IMGUI, users would hit this button. It would delete the directory, and then the Repaint() function would redraw the window, and would from thereon only contain what folders were leftover (ie, would no longer have a button to delete prior directly).

My lead wants me to convert to UI TOolkit instead. mostly becase he wants only one system to be used. And I'm not as familiar with it. And MarkDirtyRepaint won't redraw it

tulip sparrow
cobalt cradle
#

let me try

tulip sparrow
#

rather, after the deletion process, doing AssetDatabase.Refresh(); to be more specific

cobalt cradle
#

That did not refresh the Editor window unfortunately. The prior buttons remain

tulip sparrow
#

also, you have visiblity toggles for a pseudo visual removal, though, I prefer the style.display to this

cobalt cradle
#

that sounds like there's no equivalent to "Repaint" then - something that just redraws the Window GUI from scratch

#

is there an equivalent to window.Close?

tulip sparrow
#

I guess I might just be confused. I don't know how you can have a visual element removed without tellling it to be?

cobalt cradle
#

So this script reads through a directory of files. For each file it finds, it generates a button. Said button offers to delete that directory.

When I was using IMGUI, as soon as the user hit the "Delete this directory" button, it would delete teh directory and trigger Repaint(), and then the Window would flash, it would re-read the directory, and from there, for each remaining file it would draw a button.

Under UI Toolkit, however, I don't seem to have an option to Repaint() and recheck the elements

#

I'm going to try to Clear and then draw it again with a custom function

tulip sparrow
cobalt cradle
#

and THAT doesn't work either for some reason

cobalt cradle
tulip sparrow
cobalt cradle
#

when I type in visual element. remove (this) it yields an error

tulip sparrow
#

if you are using the built in buttons, buttons are their own visual element

cobalt cradle
#

I am using just plain C# buttons

tulip sparrow
cobalt cradle
#

I'm doing Button newBtn = new Button();

tulip sparrow
#

I'll type out something really fast to double check

cobalt cradle
#

and then I set it's text with newBtn.text = " My name";
And then I assign it's callback function with newBtn.clicked += () => CustomFunction(parameter);

#

how do I remove the btn from it's callback function?

tulip sparrow
cobalt cradle
#

that would mean I'd have to cache each newBtn somehow

#

because the delete command need sto come from the callback function

tulip sparrow
tulip sparrow
cobalt cradle
#

so again sam eissue- the callback function has no idea which button it's attached too. How can it unsubscribe?

tulip sparrow
#

VisualElement.name

cobalt cradle
#

So then I can name the button. Something like Button newBtn = new Button() { name = "foo"} and then I can do a rootVisualElement.Remove("foo"); ?

tulip sparrow
#

yes, alternatively, you subscribe the button to events that just do this itself, so, in the event, do something like, parent.Remove(this):

#

then you don't have to name it

#

since you won't have to find it

cobalt cradle
#

Unfortunately when I try to write rootVisualElement.Remove("buttonName"); that does not work - it produces an error

tulip sparrow
#

what is the error?

cobalt cradle
#

Says it cannot convert a string to UIElements.VisualElement

tulip sparrow
#

not to use it in that way

#

so, for example

cobalt cradle
tulip sparrow
#

if you don't want to cache

#

this is not needed, I just default to typing that out sometimes

#

that was on a parent element

tulip sparrow
tulip sparrow
cobalt cradle
#

man this is so complicated compared to IMGUI. I wish I knew why my lead was so insistent everything go to Toolkit....

tulip sparrow
cobalt cradle
#

it doesn't face an actual app user ever

tulip sparrow
#

if you look at the debugger, much of Unity is already inside of some sort of UIToolkit feature

cobalt cradle
#

I see. So this is coming anyway then

#

yeah.. that checks out. It's Unity after all πŸ˜›

#

PFFFT so I followed your code - it just clones the button

#

nope nevermind - it literally clones the entire window a second time

#

that's so silly...

tulip sparrow
#

hmmm

#

that's odd, since it should only remove the visualelement target

#

wondering if UnityEditor.AssetDatabase.Refresh() is causing it to refresh your UI along with the database, sorry, I'll try to wait and see if someone a little more experienced steps in here. I just know this channel is usually quite, so, trying to help hehe

cobalt cradle
rough scarab
#

It seems stupid to convert a functioning window to a UI system you're not familiar with

#

The lead sounds pretty foolish in this regard

#

I'm regards to Unity transitioning to UITK for the editor, the default inspector UI is now UITK, but of course there's still a ton of nested IMGUI. I would imagine it's going to stay like this for a very very long time

calm nacelle
#

is UI toolkit considered production ready in unity 2021.3?

rough scarab
calm nacelle
#

i am tired of making riddles with UI like this

#

and designer made prototypes in figma, there is bunch of CSS for rounded corners and stuff that are missing here

rough scarab
#

well, that UI is certainly doable, and easier in UITK

calm nacelle
#

maybe not if you consider that amount of groups, width of items and slots is dynamic based on scriptableobject data

#

and layout of bottom answers is custom code as drag & drop plugin doesnt play nicely with layout groups

rough scarab
#

🀷 all of that is doable. It falls apart if you want to add custom shaders, or rich text (I thought it was supported, the docs say otherwise), complex masking, world-space interactions, etc.
Layout is a strength of UITK, but it may require a custom setup, which is hard if you're not familiar with it

#

You could just experiment with dragging and dropping something together in the UIBuilder to see if you run into issues immediately

hybrid galleon
#

I'm trying to get a VisualElement to follow the mouse for an inventory system, but there always seems to be a one-frame delay in adjusting the position. The item icon's centre is snapped to the mouse position each Update like so:

{
Vector2 mousePosition = Input.mousePosition;
Vector2 pos = new Vector2(mousePosition.x, Screen.height - mousePosition.y); //inverted
icon.style.position = Position.Absolute;
icon.style.left = pos.x - sizeoffset.x;
icon.style.top = pos.y - sizeoffset.y;
}```
#

But if you move the mouse fast and take a screenshot shot, it can be 100-200 pixels off

static canyon
#

Just to say that the docs page is shall we say... on the cautious side of what's possible. I don't even know when they last updated it. Rendering UI to RenderTextures works really well and thus allows you to do pretty much anything. I've used it on a curved world space mesh in VR. Rich text is somewhat supported but not perfect (2022 has better support I believe but we're on 2021). You can't use custom shaders but you can render most things to a RT and put that in the UI if you want. Here's a screenshot showing multiple UI Docs working with 3D content, blurred layers, custom shaders for colour picking etc etc.
Biggest flag I'd raise is a year of scroll wheel speed being way too slow and basically no way to fix it πŸ€¦β€β™‚οΈ. That and other bug fixes which are taking an incredibly long time to come to 2021.

static canyon
#

VisualElement.style.translate = new Translate(1,1,0));

hybrid galleon
cobalt cradle
tulip sparrow
cobalt cradle
#

it was just a bit inopportune for him to wedge that in there on a deadline

#

especially since he isn't overhauling the older stuff yet either

tulip sparrow
#

I have been only using pointer events in an effort to apply to basically everything, including mouse, however, I am noticing some uhhh, funky things? Is not taking into account mouse also possibly screwing me up?

#

For example, here is some code I have for displaying a selected VisualElement,

            if (evt.eventTypeId == PointerUpEvent.TypeId())
            {
                if (borders == null) borders = new Borders();
                borders.SetBorderData(resolvedStyle);
                if (selectedVisualContainer != null) selectedVisualContainer.borders.SetVisualElementTarget(selectedVisualContainer);
                selectedVisualContainer = this;
                selectedVisualContainer.BordersWidth(2.0f);
                selectedVisualContainer.BordersColor(Color.red);
                this.ReleasePointer(PointerId.mousePointerId);
            }
#

works great! However, when I move an element, it sometimes doesn't do the appropriate behaviour, though with a debug I notice all the events are still firing, let me see if I can get a quick screen record of it

#

this is my field for the selectedVisualContainer

static VisualContainer selectedVisualContainer;

Maybe I'm running into a problem with things happening at the same time? Should I create a property or a method with a lock or something?

#

maybe a delegate hmm

#

okay, I think I figured I out.
I'm doing

if (selectedVisualContainer != this) borders.SetBorderData(resolvedStyle);

now. I think what was going on was I was saving previous border data so that I could switch it back to whatever the borders were before, so, i was actually resaving the border data with the selected border data. This change solves this. Alternatively, I guess I could just make a selected visual element overlay, however, I still don't know which is better? If to make a visual element for literally every little thing, or to just changes to a singular visual element

#

The benefit to using a separate visual element is when you add things like textures and stuff, things become a little more complex, where as a new visual element prevents any altering of the original. So for ease, I understand that. I'm more wondering for performance

tulip sparrow
#

so now I'm trying out something like

            if (evt.eventTypeId == PointerOverEvent.TypeId())
            {
                hover.style.display = DisplayStyle.Flex;
            }
            if (evt.eventTypeId == PointerOutEvent.TypeId())
            {
                hover.style.display = DisplayStyle.None;
            }

my question is, if I disable picking mode on an element, can I still subscribe it back to pointer over and out events? Then I can leave this inside the hover visual element specifically

tulip sparrow
#

why is the resolved style for things like flexBasis StyleFloat, and not StyleLength? Or, viceversa

#

same with why is things like height and width resolved just float, instead of StyleLength? It's very inconsistent. Not even that it's that, but the fact that there is so many values that fall under StyleLength in IStyle, that then not only don't fall under that in ResolvedStyle, but seem to resolve between StyleLength, StyleFloat, and just float

sterile scarab
#

Hello, is there any way to obtain a recently instantiated visual element width? My code is something like this:

uiTooltip = Addressables.InstantiateAsync(TooltipType.HUDTooltip.ToString()).WaitForCompletion();
VisualElement root = uiTooltip.GetComponentInChildren<UIDocument>().rootVisualElement;
Debug.Log($"layout width: {root.layout.width}");

This gives me NaN even with root.layout.max.x or layout.xMax.

I also tried with a RegisterCallback<GeometryChangedEvent> printing the event.newRect....x but this gives me 1920 (The maximum current screen size)
Any suggestion?

hybrid galleon
# sterile scarab Hello, is there any way to obtain a recently instantiated visual element width? ...

I believe that the layout engine takes a frame to arrange everything after instantiation - so if you check the layout properties like width immediately after instantiation, you'll get an uninitialised value i.e NaN.

The 1920 seems to be the width of the root visual element. When you make a new UI Document, the root element is afaik an empty parent to which all the other visible visual elements are childed.

#

So in the geometry changed callback, perhaps you can query a specific child element by name and test the width of that.

hybrid galleon
hybrid galleon
#

Using a simple object pooling system, that can be extended to highlight n number of visual elements at the same time, without having to have one border element overlay for every selectable visual element.

hybrid galleon
whole tusk
#

I can't seem to figure out how to open the UI editor....

#

I thought there was a UI windows to dragging things to the right place.

#

Oh well. Time to get to work and figure this out later today.

obsidian jungle
#

hiya, trying to figure out how to log the button I just clicked

#

closest thing i can see that might have anything to do with that might be e.target but that seems to return IEventHandler not VisualElement and there don't seem to be any properties of it that can help me here.

obsidian jungle
#

I might have asked this before... but does !important not work in USS?

obsidian jungle
#

or uh... is there any way to give your USS class priority? It keeps getting overridden by the built-in defaults ; ;

#

weird..... think i just discovered that USS selectors are applied in a different order depending on their... alphabetical make-up???? 0_o

#

when i simply make a selector for .selected in my USS, it gets positioned second, and overridden by the following 2 selectors

#

But when i select instead via .menu-generic > .selected it now has priority and is ordered last.... why is this?????? There really is no !important to solve this?

cobalt cradle
#

I am trying to become better acquainted with UXML, and I'm noticing my IDE isn't playing so nicely with it. Is there a setup or plugin I should consider? I have both VS Code and VS 2019. Either will do.

obsidian jungle
#

The only IDE I've seen that has official support for UXML and USS so far is Rider

#

VS not too good with it

#

and VSCode.... i set VSCode to interpret them as XML and CSS, and that's working ok for me so far

tulip sparrow
#

in general, to get the specifics I guess you could say of an event, you do that for everything. Such as protected override void ExecuteDefaultAction(EventBase evt) I do PointerMoveEvent e = evt as PointerMoveEvent; for certain specific things I want under the PointerMoveEvent also

sterile scarab
hybrid galleon
quartz agate
#

Hello there, any tip on how to resize a progress-bar to be smaller? I tried almost everything and cant achieve it.
I did try creating a custom uss class called .unity-progress-bar and overriding the selectors at the root progress bar element but still showing a default bar at playmode :c

Do anyone knows how to do this the proper way?

EDIT: I want to reduce it's height btw, I can increase or decrease width size without problem, but can't resize it's height to be smaller somehow

quartz agate
obsidian jungle
obsidian jungle
latent inlet
#

hi, I need some help to understand the logic to handle the "selection" of different components in a game menu.

#

the EventSystem has the SetSelectedGameObject method, but I cannot pass it a VisualElemenet (component)

#

maybe I should create a gameobject for each component in the menu?

#

at the moment each component is a template that is imported into the game menu view

latent inlet
#

how it is supposed to work UI Navigation in UIToolkit?

obsidian jungle
#

@latent inlet I'm new to these, but why use EventSystem to get the selected VisualElement? I would have thought registering a callback to the element to log itself when clicked would be the way to go.

#

my own question: I asked on Unity Forums how to force dark mode, only answer is from a Unity rep telling me "you should support light mode". Aside from the fact that I'm none the wiser as to how to force dark mode... does anyone happen to know how to provide light and dark styles? Is there a UXML tag to support alternative USS sheets? or some variable I can check in C# like Editor.isDarkMode or something so I can manually swap out stylesheets in code after checking this?

#

ie. is there some way I'm able to check Preferences in C#?

tulip sparrow
# obsidian jungle ie. is there some way I'm able to check Preferences in C#?

I unfortunately only do most my stuff within my own C# code, so, don't know much about doing things with a sheet, however, if you do it this route, from my most simplistic way to handle something like this, I would probably just alter style.backgroundColor between black and white colors, and then some sort of altering possible between style.Color for the text color, and/or style.unityTextOutlineColor, style.unityTextOutlineWidth

#

if you alter just the outline, you possible don't need to worry about style.Color at all

obsidian jungle
#

hm, my editor is large and complex lol

#

it would be a lot of elements to manipulate individual styles on directly in C#

tulip sparrow
obsidian jungle
#

i think where im stuck is not so much what to change, but how to know if the user is in dark-mode or light-mode

#

i cant really alter anything unless there is some way i can tell

tulip sparrow
obsidian jungle
#

just for editor

#

UIElements is pretty cool after dealing with IMGUI for so long lol, but man I wish it had closer parity with HTML/CSS. There are a few things it really hits a brick-wall on at this stage lol

#

I actually would have no issue currently if I just used default theme styles for everything, but my UX would suffer as a consequence, need those custom colors in background for readability, but the second I do, it works great for dark-mode but terribly for light-mode

tulip sparrow
obsidian jungle
#

ah dont worry lol, dont wanna chew up your time on it haha, ive dug around a bit already, doesn't seem like optional stylesheets, mediaQueries, or a theme-check in C# exist at the moment lol. I have a topic open in Unity Forum so hopefully that grabs some attention

#

my editor looks like complete @$$ in light-mode ^^;

tulip sparrow
obsidian jungle
latent inlet
obsidian jungle
#

innnteresting

tulip sparrow
# obsidian jungle innnteresting

okay, I knew I remembered somewhere how, but couldn't remember, however, I think this is what you want to check EditorGUIUtility.isProSkin

obsidian jungle
#

ooooh

#

interesting, I'll try now

#

seems it's still named from the old days hehe

tulip sparrow
obsidian jungle
#

no need, that's perfect, ty, it works

tulip sparrow
# obsidian jungle no need, that's perfect, ty, it works

oh okay! Only reason I mentioned it is IDK if this specifically lets you check if light or dark. IIRC is is pretty convoluted, as in, you need to get the IDs for them, and then you have to check that specific ID or something

obsidian jungle
#

oh wow haha, sounds heavy. Well, for now, this is great, I can start adding conditions to the start of each of my editor scripts

tulip sparrow
#

I use to have a list somewhere that had a lot of the the native IDs for different things in Unity lol, but can't find it right now. For example, all the IDs needed to do something like changing the cursor to a specific icon

obsidian jungle
#

first I've heard of em, that's made handy tho

tulip sparrow
# obsidian jungle first I've heard of em, that's made handy tho

yeah, I've been creating custom icon scriptable objects thing through UIToolkit, so happened to come across them in the process. It is kinda annoying though, because like, Unity has like 100 different versions of some icons lol, so scrolling through the list is just annoying

flint wagon
#

Hi guys ! I'm trying to create my own VisualElement to create a tab system

#

Is it possible to create a new EventBase to have my own callback that work with my tabs?

tulip sparrow
flint wagon
#

Okay thank-you ! Interresting, i didn't see it but what i'm making looks quite similar. I have thought about using my own delegates but i thought it would be "cleaner" if i could implement it in a way that you wouldn't even notice it's not smth built-in haha

tulip sparrow
flint wagon
#

Actually i think i need only a way to dispatch that a tab has been switched and it will be enough πŸ™‚

tulip sparrow
#

I'm going to try and explain this without a screen record, but, I'm trying to think about how to best approach allowing an element to be adjustable that is a relative position, without necessarily having any impact on the other siblings. I'm struggling to find a route to go, so, had a couple directions I was thinking about going and could use some advice? One was to make an invisible element that basically takes the current place of the element being altered and then making the element just absolute position. The other was to make it absolute, but then alter the padding and such of the other elements to pretend there is that element still there.

#

the other thing I was considering was just possible scrapping using relative on basically all my visualelements and just using absolute on everything

velvet frost
#

does changing variables of VisualElement.style actually do anything or is it only meant to access values for inline styles?

velvet frost
tulip sparrow
# hybrid galleon What's the use case?

Nothing specific atm. I'm reducing some of my visual elements and instead created 1 called public class Interactive : VisualElement with things like

    public enum InteractiveOptions
    {
        None = 0,
        Draggable = 1,
        Expandable = 2,
        Hoverable = 4,
        Selectable = 8,
        All = Draggable | Expandable | Hoverable | Selectable
    }

so, was looking for a catch all, well, better than what I already had setup. In my original Expand visual element I was checking vs every different alignment and stuff in a parent element and having the visual element adjust, but, was looking for maybe a more simplistic approach

hybrid galleon
#

Someone on this thread just brought them to my notice actually

tulip sparrow
tulip sparrow
#

do you guys have a better naming system or something I could use in case of

        public enum AlignmentOptions
        {
            TopLeft,
            TopCenter,
            TopRight,
            CenterLeft,
            Center,
            CenterRight,
            BottomLeft,
            BottomCenter,
            BottomRight
        }

IDK, I'm just not liking it this way. I was thinking about calling it Anchor instead?

wary cloud
#

why the hell doesn't this work???

#

why do I have to do this now?

tulip sparrow
wary cloud
#

no I meant like

#

referencing it

#

I made it in UIBuilder

#

and I couldn't reference it using Query

#

so I had to create it like this for some reason-

wary cloud
#

but this did-~

tulip sparrow
wary cloud
#

I guess?

#

ok now it works-

#

maybe it just got deleted

#

I do have another question tho

#

I have multiple menus I wanna cycle through, and when I make one invisible and the other visible, it looks like this~

tulip sparrow
# wary cloud maybe it just got deleted

I obviously can't say for sure, but, it might fall under the same principle as when a Unity restart fixes a problem you are having. Possibly just something wasn't updating correctly, and then it was fixed

tulip sparrow
wary cloud
#

oh ok that works!

#

I just used the .visible variable

#

:/

tulip sparrow
#

IDK if it ever got "fixed" or made better

wary cloud
#

well, thanks for the help!

tulip sparrow
#

Is there a way with relative position to do a JustifySelf?

whole tusk
#

I can't get Visual Studio 2019 use/recognize the UI Toolkit. In Unity I already selected Visual Studio 2019 as the C# editor and did the "regenerate project files".

tulip sparrow
#

hmm what am I messing up here? I have 1 visual element with flexGrow set to 1.0f, and one with it set to 3.0f, but they are both still doing a 50/50 share

#

nvm, I think I figured it out, but, not sure what value to set at. The child element was with flexGrow 1.0f was causing it ti still take up half, but, it confuses me, because I thought sibling flexGrows were taken into account when flexing also? I mean, it is, but like, idk

quaint pewter
#

I recently upgraded my editor version from 2020.3.26f1 to 2021.3.2f1. Along with that came an update to the UI Toolkit. I have a scene that uses UI Toolkit to display a button with a clicked event for displaying a UI menu. In addition, I had implemented swiping detection for other game objects in the scene. These swipe events require an EventSystem be present in order for the events to register. Since the upgrade, the UI Toolkit clicked event does not work unless I remove the EventSystem object from the scene, but then the swipe events do not work.

I just realized that a PanelRayCaster component gets added as a child to the EventSystem in the hierarchy when running the project, and if I disable that component, then both the swipes and the UI Toolkit clicks work as they did before the editor upgrade. So I've added this code to my scene, and now I'm just wondering if there will be unexpected (undesired) behavior down the line because of this:

var es = FindObjectOfType<EventSystem>();
es.gameObject.GetComponentInChildren<PanelRaycaster>().enabled = false;

tulip sparrow
#

If whatever you are doing works without it, unless you have something that has reliance on this specific thing, there shouldn't be?

#

Does anyone have any familiarity with FlexBasis? I'm thinking it might be something I need to tweak to give me more accuracy, but, I haven't really messed with it at all. I'm having a problem that some of my flexing doesn't seem to be flexing with same settings that I have on elements in the yoga playground

#

I've only debug checked the values of a default VisualElement style though, maybe I need to check if something is different in the TextElement default style values that are causing me a problem

brisk pulsar
#

Hey, I create a simple layout using UI Builder, and I've queried a VisualElement that I have, and in code, I want to get its Rect and render using IMGUI.

The problem I am having is the Rect I get from the VisualElement seems to be off, the width and height seem to be correct but the x and y seems to have an offset, any idea why?

#

I am using worldBound by the way to get the rect

tulip sparrow
# brisk pulsar I am using `worldBound` by the way to get the rect

I haven't used worldBound, so idk if it does anything different, but, the default pivot iirc for Visual Elements is the top left corner. So, the width measurement should return values to you from left - right, low - high, and the height is top - botton, low - high

brisk pulsar
#

.style.left should be 0 (I assume)

#

there are 4 Rect's in VisualElement 3 of which in local space, and the only one in world space is the worldBound, I'll try to debug and see if I can find where the proper values are stored

tulip sparrow
#

also note that resolvedStyle changes take a frame to update

brisk pulsar
#

Cool, didn't know about that

tulip sparrow
brisk pulsar
#

Got you, trying it right now, if it does take a frame to update it shouldn't be that bad, I could delay my render by one frame also I assume

#

It seems like worldBound contain the same values as resolvedStyle

tulip sparrow
# brisk pulsar Got you, trying it right now, if it does take a frame to update it shouldn't be ...

Here is an example though for style and resolvedStyle. I'm wanting the values for alignContent and alignItems. The first 2 debugs are from style, the second 2 are from resolvedStyle. The only reason the second one isn't showing up as a null from this debug is because I am directly setting style.alignItems = Align.Stretch; in the code before it. In this case, you CAN read from style for immediate accurate results

#

but if you are using Style Sheets, you basically need to rely on resolved style if that is where you are making most of your changes

brisk pulsar
#

That make since, I seem to be getting the right values but there is a slight offset, and it seems like resolvedStyle (Checked all its properties) contain the same values that I use

#

So it seems to me its something to do with the layout itself maybe

#

Or stupid me doing something wrong

tulip sparrow
# brisk pulsar It seems like `worldBound` contain the same values as `resolvedStyle`

oh, my comments are mostly... uhh if dealing with flex, I find more success in checking Resolved Style for things. In terms of your question and sorry about the long route, the pivot should always be the top left. I'm not entirely sure how to actually change that, however, you can use transformOrigin style to possible offset positioning if there is a different pivot? Besides that though, I usually use translate to offset already assuming top left

#

.style.Left does different things depending on if your VisualElement is absolute or relative

brisk pulsar
#

Yeah I know that, the pivot position is not my problem, I'll attach an image and try to explain

#

I have a simple setup using VisualElements, you can see the grey ones, and there is a transparent one in the center (where the white rect is, which is rendered in IMGUI).
You can see that the rendered rect, that uses worldBound, has an offset, I tried using the values from resolvedStyle but they are getting me the same rect

#

GUI.DrawTexture(_centerElement.worldBound, EditorGUIUtility.whiteTexture);

This is my draw call from OnGUI

tulip sparrow
#

your offset must be wrong

#

that is the only thing I can think of

brisk pulsar
#

Actually it seems to have an offset in y exactly the amount of the EditorWindow title

#

I think so at least

tulip sparrow
#

But, why are you trying to mix IMGUI and UIToolkit this way?

brisk pulsar
#

Maybe not, anyway I am not sure where I am wrong with my offsets, I didn't apply anything on my end just took it from the VisualElement

brisk pulsar
tulip sparrow
brisk pulsar
#

Haven't tried IMGUIContainer actually, I'll read up on that

tulip sparrow
#

Only reason I brought it up was that if you use that Container, you may not even need to account for an offset

brisk pulsar
#

Oh okay that sounds great!

#

sounds like exactly what I need

tulip sparrow
brisk pulsar
#

That might work

#

I have a few things I need like repeating the texture and manipulating the UV, I'll need to check if I can do it in the way you suggest

tulip sparrow
brisk pulsar
#

Lol

#

You helped a lot!

#

thanks!

#

IMGUIContainer really seems to be lacking examples

#

Oh but I found an article, basically he inherit from IMGUIContainer and register a function to onGUIHandler, the only thing left is figuring out how to properly create my custom IMGUIContainer (there is a IMGUI Container option in the Library inside UI Builder, but I am not sure how to use it)

#

Ok, created it in CreateGUI and it works perfectly! the worldBound now has the right values!

tulip sparrow
#

FlexShrink still confuses me. I'm not sure why removing it off any element fixed some of my flexing problem

#

I think part of my problem and something I need to maybe get better at is, if I flex a child element, I don't need to set the flex on the parent?

brisk pulsar
#

I think that the parent wont use the flex system but its child will

tulip sparrow
#

hmm nvm, I think I finally figured it out. Still not sure why yoga playground gives different results with same settings, but, if I do my weight on 1 element with flexGrow = 1.0f, and another as 3.0f, if I set the flexShrink to 3.0f on the first element, I get the accurate flexing I'm looking for

brisk pulsar
#

what layout are you trying to achieve?

tulip sparrow
brisk pulsar
tulip sparrow
#

I'm trying to figure out why this happens? I have things like flexWrap set to no wrap etc..

brisk pulsar
#

Can you show your hierarchy?

tulip sparrow
#

TextElement.isElided might be what I need to mess with let me see

tulip sparrow
brisk pulsar
#

Oh okay, thought you are using UI Builder

tulip sparrow
#

okay, I found the correct thing to edit style.whiteSpace = WhiteSpace.NoWrap;

#

which is confusing

#

not in terms of what it does

#

but the wording used along with other properties

fervent bay
#

Hello, is there a "not" operator in uss ? Like I have a hover state on all my btns but I dont want the hover state if the button also have the active class

vapid patrol
#

Am I doing this right?

untold nacelle
#

anyone can help me? i placed a button in my canvas, with the functions of i need, but i cant press the button

#

i'm trying to click, but without success

lunar rain
ebon summit
#

hey I noticed shader support is still unfinished for UI Toolkit, I was wondering if it's possible to embed a canvas for a hybrid approach

vivid merlin
#

Hello! I'm in a conundrum coming over from uGUI to UI Toolkit.

#

On the Right is my uGUI Canvas with buttons, using the same 9-slices as on the Left, which is in UI Toolkit.

#

I don't have, from what I can tell, the ability to scale the pixels per unit in UI Toolkit like I can in uGUI.

#

So my sprites are doing some stretch-y weirdness on the UI Toolkit.

rough scarab
vivid merlin
#

They just warp the sprite. They don't seem to scale it.

lunar rain
#

Any ideas why unity is spamming these error when I'm moving the UI elements (inside UI Builder window) or doing almost anything else?

tulip sparrow
#

I know this might sound silly, but, why are things named AlignItems and JustifyContent? Why isn't it just called CrossAxis and MainAxis?

#

like, I understand that the goal was to imitate the current web flexbox, but, seems odd to me to not make it better. Would make more sense to just have AlignMainAxis, AlignCrossAxis, and stuff like that, idk, I just find it weird I guess, not that it doesn't work.

tulip sparrow
#

is there a way to do something like Align.SpaceBetween with a fixed number?

#

I'm trying to make a default value of space between visual elements in a list, maybe I can just have the list edit the childs margin when it's added?

#

I guess I could also uhhh increase the height of the list and use SpaceEvenly, but, hmm

#

oh nvm we don't have a SpaceEvenly

obsidian jungle
#

Anyone have any best-practices for modifying integers with a dropdown?

I have a database with a few lists in it, but i never cache these in my codebase, ever, instead i expose methods to grab list-elements by index, and in my custom-inspectors, i read from the list to populate dropdown names, but i use this to customize a "selected index" integer.

So the problem I have is that there are tonnes of best-practices floating around for UI-Toolkit about working with SerializedProperties to automate SetDirty() and Undo/Redo. But I'm not able to bind paths from a dropdown to an integer, instead I am manually updating and applying modifications to serializedObject everytime my dropdown changes, and in 2 other instances if my Dropdown has to refresh its options when the core list updates.

#

in short.... how would YOU best-manage SetDirty/ApplyModifications etc. in UIToolkit when you are manipulating an integer using a dropdown that sources its choices from names in a list of objects?

tulip sparrow
#

IDK if this is best, but, this is what I ended up settling on for my question for now

        public void AddItem(VisualElement item)
        {
            foldout.Add(item);
            item.style.marginBottom = 10.0f;
        }
obsidian jungle
#

ah, you mean you'd suggest a foldout instead of dropdown?

tulip sparrow
obsidian jungle
#

allg ^^

obsidian jungle
#

and a custom inspector capable of browsing that list and assigning it to my MonoBehaviour as an integer

tulip sparrow
obsidian jungle
#

this may be bad form, but I'd appreciate anyone looking over this to point out anything obviously stupid that I'm doing here

#
[CustomEditor(typeof(Test))]
public class CustomTest : Editor {
    private TemplateContainer ui;
    private DropdownField ddfEnemySelect;
    private SerializedProperty _iEnemy;

    private void OnEnable() {
        _iEnemy = serializedObject.FindProperty("iEnemy");
    }

    public override VisualElement CreateInspectorGUI() {
        serializedObject.Update();

        VisualElement root = new VisualElement();

        VisualTreeAsset visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/Test/Resources/UXML/EditorTest.uxml");
        ui = visualTree.CloneTree();
        root.Add(ui);

        GetControls();
        InitializeDropdown();

        return root;
    }

    private void InitializeDropdown() {
        RefreshNames();
        ClampEnemyIndex();

        ddfEnemySelect.RegisterValueChangedCallback(_e => {
            Debug.Log((VisualElement)_e.currentTarget);
            _iEnemy.intValue = ddfEnemySelect.index - 1;
            serializedObject.ApplyModifiedProperties();
        });

        Debug.Log(_iEnemy.intValue);
    }

    private void GetControls() {
        ddfEnemySelect = ui.Q<DropdownField>("drp-enemy");
    }

    // Get names from my list again, in-case the list has changed. Rename empty objects, update index.
    private void RefreshNames() {
        List<string> names = DBResources.GetEnemies.enemyList.Select(x => x.name).ToList();
        names.Insert(0, "-");
        for (int i = 0; i < names.Count; i++) {
            if (string.IsNullOrEmpty(names[i])) {
                names[i] = "UNNAMED";
            }
        }

        ddfEnemySelect.choices = names;
        ddfEnemySelect.index = _iEnemy.intValue + 1;
    }
}
#

couldn't fit the last method in

private void ClampEnemyIndex() {
        if (_iEnemy.intValue >= DBResources.GetEnemies.enemyList.Count) {
            Debug.Log($"(>=) {_iEnemy.intValue}");
            _iEnemy.intValue = DBResources.GetEnemies.enemyList.Count - 1;
            serializedObject.ApplyModifiedProperties();
        }

        if (_iEnemy.intValue < 0) {
            Debug.Log($"(<0) {_iEnemy.intValue}");
            _iEnemy.intValue = -1;
            serializedObject.ApplyModifiedProperties();
        }
    }
#

this is basically my test script im using to get better at UIElements before i proceed any further

obsidian jungle
#

ignore the bizarre -1 and +1 stuff floating around with my index there, it's a countermeasure after faking a null option into my dropdown choices which provides a -1 index later

tulip sparrow
#

then, on your dropdown events for example, when the the value changes, you call this with the target object

obsidian jungle
#

yeah, I see, smooth, I like it

#

wish i could just bind a dropdown to an integer lol, why string is only option ; ;

#

need 2-way binding like in angular and react

#

i'll have a go at adding the extension method later, couldn't resist planning out my evening while im still at work lol

#

I'm also looking at making my own Dropdown class that connects itself to a list that I can just modularly distribute across my many custom editors, so extension methods will definitely become a valuable part of the system here.

tulip sparrow
obsidian jungle
#

nice

#

I'm still at a stage where extension methods don't naturally occur to me like other structural ideas do lol

tulip sparrow
#

I have been making my own things personally instead of using Unitys for stuff like Dropdown. IMO, and it may just be me and overthinking, but, they just make it so hard it feels like to customize any of there things, and excessively limit things you might want to actually edit through private protected internal keywords

obsidian jungle
#

usually takes someone else pointing out obvious ideal cases for them lol

obsidian jungle
#

scraped my brain on how to use their listView and their documentation has an example buried in there somewhere and they cover a lot of the complex thing their ListView does, meanwhile i'm beating my head against the screen saying "HOW... DO... I... CONNECT... MY... LIST... TO... THE ... LISTVIEW?"

#

(I've figured it out now, s'algud, but the experience of learning how was nuts (documentation is also a bit better now))

#

in my above code snippets, would you say my 3 uses of serializedObject.ApplyModifiedProperties(); for the one piece of UI is excessive? Or is that a normal situation to have?

#

coming from IMGUI, I just have one EditorGUIUtility.BeginChangeCheck() at the start of my editor window, and at the end I just put

if (EditorGUIUtility.EndChangeCheck()) {
  so.SetDirty();
}

which unfortunately seems more elegant by comparison. So I was wondering if I was being a bit crazy with how often I'm repeating serializedObject.ApplyModifiedProperties(); here, and for just one control, imagine when I have many more (it will still be multiple calls, even when I use extension method).

Is there no sortof... event or callback i can use within a Custom Inspector that can respond to UIElements changes?

tulip sparrow
#

I haven't done anything with that in a while, but, from what I can remember, I use to just throw that in at basically the end of everything

obsidian jungle
#

yeah, it was capable of tracking your entire GUILayout with a single call, which was super handy. Basically only needs to clamp start and end of your editor window and job done

#

i know it'd be a fool's errand to pursue parity between IMGUI and UIElements cos they are different beasts, so probably some of my clumsiness right now is just growing pains as I move away from IMGUI

#

it was ultimately USS that won me over lol

tulip sparrow
#

hehe, IDK if it is or not. I was trying to find a way to create my own UI system all together, but, not enough experience or know where to really start, so am basically building backwards... which doesn't sound fun, but it is fun for me hehe, but, basically, to an earlier thing we talked about, for UIToolkit, I use a lot of Unitys things, but, as placeholders essentially. Then slowly break it down into my own visual element as the base

#

which has ultimately lead to me still using a lot of Unitys things, but, created custom visual element I add to them as children to do some things

obsidian jungle
#

understandable

#

i will say though, for all my headaches and complaints about it so far, I am enjoying exploring it

#

my UI looks 10x better, just its a bit harder to pull together lol

#

but my codebase is also much cleaner for switching to UIElements in general

#

if not "smaller" its at least more logically structured

tulip sparrow
#

Honestly, it felt easier to deal with than the other system. I was just beginning in Unity at the time, so didn't have much experience with it, but, for some reason I find at least the direction I'm going with UIToolkit to be a lot less convoluted than the other system. I just hated making a gameobject for every little thing

obsidian jungle
#

ah UGUI, yeah

tulip sparrow
#

I mean, it is almost the same idea with using a Visual Element for every little thing now, but, idk

#

should I put a scroll view as the child of a foldout, or a foldout as the child of a scroll view

#

I guess it would make more sense to have it the child of a foldout? So, if the foldout value is false, it won't even show?

obsidian jungle
#

yeah cos the foldout's job is to hide and show the thingy

#

whereas its the thingy's job to manage its own content

tulip sparrow
#

so I see this Scroller class, what visual element should I put it as a child of?

#

for a list

#

actually, nvm, guess it would depend on what I want to do with it, but, I guess I would put it as a child of the element that holds all the children so it will flex them easy enough

storm siren
#

Is there a equivalent to :not in USS? I want to apply a class only if the element is disabled, like .something:not(.unity-disabled)

tulip sparrow
tulip sparrow
storm siren
tulip sparrow
#

the interface

#

I think the USS is only for setting those values? (Sorry, not 100% sure, as I do all my UIToolkit through C# only)

storm siren
#

yes, but you can add "dynamic" styles with USS, like :hover for when the element is being hovered

#

so you have a set of style properties for when the element is normal and when it is hovered

tulip sparrow
#

well, from what I'm assuming. Let me see if I can find some more info

storm siren
wary cloud
#

how can I make a Transform reference field like this?

storm siren
tulip sparrow
storm siren
#

there doesn't seem to exist an event for enabled/disabled 😦

tulip sparrow
wary cloud
#

why do my foldouts not work correctly-

#

I restarted the project and they don't scale properly anymore----

#

it works if I scale the window higher???

tulip sparrow
wary cloud
#

it works in a new file

tulip sparrow
# wary cloud huh.

give me a sec to open up the UI builders see if I can look at it from there

wary cloud
#

flex settings on the sliders

tulip sparrow
#

that is your problem

#

you have Shrink at 0

#

meaning it isn't flex shrinking

wary cloud
#

I had to change shrink to 0 on the groups

#

and grow to 1

tulip sparrow
#

Specifies how the item will shrink relative to the rest of the flexible items inside the same container.

wary cloud
#

it now works

wary cloud
#

thanks for pointing those variables out

tulip sparrow
#

and Unity defaults it to 1

wary cloud
#

yeahhh

#

grow would be more used-

#

also, another question, is there any way I can add something like this

tulip sparrow
#

or does it matter if it is editor?

wary cloud
#

uhh

#

I am making an editor tool

#

so

tulip sparrow
#

okay, then you can use UnityEditor.UIElements.ObjectField

#

and set the objectType to Transform

wary cloud
#

I'm making a custom view for the inspector for a script

#

so technically

wary cloud
tulip sparrow
wary cloud
#

lmao

tulip sparrow
#

okay, so, you need to click on your root element in the Viewport

wary cloud
#

yeah

tulip sparrow
#

in the inspector make sure Editor Extension Authoring is enabled

wary cloud
#

and enable editor extensions

#

yup

tulip sparrow
#

then in your library

#

Object Field should show up

wary cloud
#

oh yeah

#

object field

tulip sparrow
#

you can also click the triple dots on the library title bar to enable editor extension authoring

#

however, that doesn't seem to work for me

wary cloud
#

it does for me

#

that's how I do it

#

how do I set the type god damn it I need sleep

#

Type

#

there

#

scam