Download

Check Box Problem/Bug?

I’m creating some check boxes for selecting different aspects of difficulty, number of enemies, quality of their armor, etc.

I have a text box nested to the check box like so:

[Check Box]
____[Text Box]

Everything worked fine until I decided that the check boxes were too small. I found a scale option and scaled them up. Then things went crazy. The text gets scaled up too, but that’s not a problem as I can adjust it’s scale down to compensate. That text though, gets pushed far to the right, and there doesn’t seem to be a way to move it back.

So at first I had:
[ ] _ [Text]

Now I have:
[ ] ___________________________________________ [Text]

Though the box is bigger, the text is pushed far away.

It also can’t be put inside the scroll box any more. While technically it can, it doesn’t stay within the bounds. The box gets hidden far off to the left.

What am I missing here?

Thanks

Do not put text inside the check box. Instead:

[Horizontal Box]
– Checkbox
– Text Block

Now you have separate and granular control over both.

Ideally you’d wrap the checkbox with a user widget and then wrap the text block with a user widget and then wrap both with another user widget.

You can now make highly configurable switches and add them to any menu. And if you ever need to alter something about how they look / behave - you only do it to one widget, rather than visiting 17 menus and laboriously adjusting hundreds of elements manually…

I thought of that already. The problem is that all of these options are inside a scroll box. When I separate them as you suggest, the check box is no longer lined up with the text that goes with it.

You can control it with fill. Can you show an example?

I have no idea what any of this means. What’s a “User widget”?

I don’t need 17 menus. One scroll box works well … (until I scale the check box)
Scroll Box-----------------------------
[ ] option 1
[ ] option 2
etc

When I scroll the check box it becomes:

Scroll Box-----------------------
________________ option 1
________________ option 2
etc (with the boxes being hidden off to the left of the scroll box.)

No, once I scale the check box ‘fill’ no longer does anything.

I might have to wait until I get home to show an example. I’m at work and can’t hook my laptop to the network.

Sorry mate, it does not add up and is hard to understand what you’re after.


  • at the very least, create a widget that represents check box and text:

  • add them to a scrollbox in a main widget:


  • the user widget can have an instance editable variable:

  • so you can rapidly make a uniform looking menu:

This is just a quicky, ofc. The rabbit hole goes deeper. This would also allow you to dispatch data from those user widget so it’s then easy to actually find out who is calling - which checkbox is ticked, for example.

1 Like

Fill:

  • checkbox takes 20% of the available space

  • text takes 80%

  • the above produced this:


And that’s the thing about user widget, I can now keep configuring that checkbox + text combo and all elements in the scrollbox will behave like so.


If in doubt, perhaps you could include a screenshot of the desired effect.

1 Like

Hmm,

Let me go through all that.

@[Everynone]

That’s a great way to make the buttons. Thanks for sharing that. I haven’t fully understood it yet, but I’ll keep working on it.

One problem though … you still can’t scale the checkbox without it messing up. Go back into your customCheckboxText widget and scale the checkbox up. You’ll see the problem.

Looks as I expected it to after scaling:

Bad. You’re not supposed to scale it like this, though - use styles:

Also, important for UI:

Aim at making them white with transparency - easier to work with them later on.

1 Like

@Everynone

When you scale yours, it stays in the box. When I scale mine, the left part of the check box ends up outside the box. Maybe this has something to do with the ‘borders’. I’ve never used them before, so maybe I set it up wrong.

As above, do not use Transform Scale - it will not conform. Use styles:

image


Scaling will work but you’ve asked the widget to just scale up (from its centre outwards) - if you do, you must also ask it to move:

But don’t, it will probably just overlap. Consider working with Image Size and ensure the image you’re using is large enough.

As soon as you start fiddling with scale, and translation in general, the Desired Size of the widget is no longer reported accurately (I mean, it is, but not to the human eye, it is not); other elements and the parent container depend on it for the layout.

UMG is not pixel perfect everywhere.

1 Like

PERFECT. :wink:

1 Like

@Everynone

OK, Very much appreciated. I got it to work both ways. The first way by adjusting the padding on the border.

And then I tried messing with the styles and got that going too. The only problem I see with doing it with styles is that you have to set the size half a dozen times. Once in “unchecked Image” again in “uncheck hovered image” and “unchecked pressed image” and “checked image” etc…

Either way, I very much appreciate your help. I would never have thought to make one reusable widget like that. Good stuff. Thanks for sharing.

Imagine setting style numbers for a bunch of widgets separately - madness. But if you’re planning something with scope in mind, you do not want to do things manually - you create and configure slate brushes & styles:

And then use them throughout the interface. You can apply them to elements in loops, without ever punching more than 1 number.


But that’s a story for another day - the rabbit hole. How much automation is needed really depends on what the long term plan is.

Do I spend 1h connecting wires 1-by-1 now - a.k.a. the carpal tunnel with extra steps. Or spend the next 10h making a system that automates it?

My personal ratio is 50-50 for choosing the wrong thing. So there’s that.

Ah yes, the Minecraft dilemma. Do I spend an hour gather the resource or do I spend 10 hours designing and building a machine to automate the production of the resource? I’m not going to lie, I make the machine.

… but I think I’ll leave slate brushes for another day. My menu system doesn’t need any more check boxes (… right now anyway.)

1 Like

@Everynone

OK big problem. With the button set up in this way, I can no longer get the “On Check State Change” event. They look nice, but if I can no longer use them …

As mentioned above - dispatch it. Depends on what you really want do. Do you want to drag them one by one or do you want to perform special actions in bulk? I’ll give you an example.

  • the most straightforward way:

  • so the main widget can catch it:

There are better ways, though.