1
\$\begingroup\$

I've tried a basic google search and am still having trouble with this one.

Unity encourages the use of UI Toolkit at this point, as opposed to their old system, so that's what I'm going with; I have a status bar planned filled with image icons. Like so:

Bar, Left Aligned Elements

However, I'm trying to get its elements to right-align, like this image edit:

Simulated intended right alignment of elements

So far, the most I've come up with is style/align/align-items, but none of its options seem to have any affect on the actual item alignment. What am I missing here?

Thank you!

\$\endgroup\$
2
  • \$\begingroup\$ Might i ask why you're using a scrollview? if there would be more than the currently shown icons should it be horizontally scrollable? \$\endgroup\$
    – TheWolfNL
    Apr 11 at 12:23
  • \$\begingroup\$ I don't know all of the defaults with UI Toolkit. If I may say so, coming from Qt/GWT, they're weird. Every windowing kit I've ever used would insist on a scroll view for the concept art, to behave predictably. UI Toolkit seems to have an ideal standard for my art vision, and it isn't correct. We're probably just going to pull the art out and reimplement it in a different engine at this point, to be honest. \$\endgroup\$ Apr 13 at 14:23

2 Answers 2

1
\$\begingroup\$

Have you tried putting the image you want to align within a visual element? And then using that as a container to set the alignment on. I'm still new to UIToolKit but I think this should work.

\$\endgroup\$
1
  • \$\begingroup\$ That's what I ended up doing; though I must admit it feels like a bit of a hack. So, I defaulted to a more consistently stable method. \$\endgroup\$ Feb 16 at 16:03
0
\$\begingroup\$

Evidently, after some investigation on the Unity Forums, this is pretty much impossible right now. I would have to use the old Unity UI system to have that much control.

There may be a way to do it, but it requires digging through the UI Debugger—which it really shouldn't—and most of the properties seem to be entirely undocumented right now.

Better to keep it simple.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .