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.
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.
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.)
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.
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.
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.
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.
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:
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.)
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.