Check Box Problem/Bug?

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.

A much better solution (might be scenario specific) is to equip the Event Dispatcher with more data:

  • each checkbox can be configured to do something specific:

Above, the custom checkbox + text widgets holds onto an enumerator that describes its purpose.

  • this is then dispatched:

image

  • and caught in the main widget:

You could even add a self reference so the owner knows precisely which checkbox widget was ticked.

selecting different aspects of difficulty, number of enemies, quality of their armor

I’d add an enumerator for those and an int as a value.


Note that the amount of script would be the same for 2 or 200 checkboxes.

I think the first way might work for me. I didn’t take it to a fully functional test yet, but I’ve got the ED_My State event showing up on the buttons. I don’t want to waste a lot more time on it because I’m thinking I’m going to have another issue when I try to use that event to uncheck other checkboxes.

The “much better” doesn’t seem to because I don’t have the “Action for This Checkbox” option and can’t figure out how to create it.

Either way, I think I’m better off going back to my original

[Checkbox]
____[Text]

method now that I can change the size of the check box with the styles and not mess everything up. This gives me the event I need without all the extra code, (event dispatchers and such). All I need is to have boxes 1, 2, and 3 unchecked when I check box 0 or 12, 13, and 15 unchecked when I check box 14, that sort of thing (and set variables once apply is clicked). No need to get super fancy.

I appreciate all the help. I learned a lot about this stuff that I didn’t know before. I’ve put off making a menu for a long while now and I’m glad to finally be getting it done. I want hurry up and get it finished so that I can go back to the fun stuff.

1 Like

In case you ever decide to revisit this:

It’s an enumerator you create yourself and add as a variable to any blueprint:

  • the checkbox widget could have one and some value:

  • those values can be then configured in the parent widget scrollbox:

  • so I’d normally handle it like so to keep the graph clear:

Ticking the Epic Loot checkbox sends the scrollbox widget a message with value 5 - this will also tick (or untick) something else; here, it’d enforce Difficulty.

because I’m thinking I’m going to have another issue when I try to use that event to uncheck other checkboxes.

I’d say quite the opposite. It’d would simplify things greatly. But ofc, you look at the size of what you’re making vs time it takes to set it up + the upfront cost of learning something that may not be that useful and choose the best tool for the job!

Good luck!

I think I’ll follow through with it, mostly because I don’t want to rebuild all 22 checkboxes for a 4th time … and, you know, because I like to learn. Most everything I’ve done in Unreal so far is about learning rather than making a game. I tend to try to find the most difficult thing I can think to try, and then try it. And now I’ve got a whole slew of cool mechanics that are begging to be turned into a game. This project is my first attempt “make a game” so I’ve never really had much of a need for a menu until now.

Anyway, I’ll try to finish incorporating that method tomorrow night. I’m about to get off work and go home to bed.

I’m glad I happened upon your path tonight.

1 Like

And there’s always a chance for the Game 2 at some point.


Also, I left this link before but deleted it, thinking it might be redundant but if you ever need exclusive checkboxe list that allows only for 1 pressed element:

I was trying to implement the setup you provided in the link above (UMG Toggle Buttons). In the first picture from your post there you have a reference to self being input into the dispatcher. How are you doing that? What type of variable did you set up in the ED? I setup a variable of type ‘check box’, but I can’t attach a reference to self to it.