Hi. i’m trying to make a menu where the player can select from multiple options. i made the single item widget and another widget that will hold multiple of this. My problem is that i’m trying to make it automatically, rather than one by one. i’m iterating over a data table with a loop and for each result i make a new widget and append it to the canvas as a child but i can’t find a way to edit the variables of this child widget.
You can drag from the Return Value of the “Create WB Card Selection Widget” node and access all variables and internal components in the WB_CardSelectionWidget
. You can also call any public events and functions made in there. (if you prefer to call initialization events)
Alternatively/additionally you can expose some of the variables of WB_CardSelectionWidget
on spawn (through the details panel when you select the var) and they will appear as inputs in the “Create WB Card Selection Widget” node.
i tried via the Create WB Card Selection Widget return node, but from there i can only get the variables, i don’t have any set function available, i also tried promoting it to a variable and even casting it to the widget but still no set node.
I can’t expose the wisget variables for some reason, if i try to press the eye near the variable it refreshes and does not open.
If you can get the variables you can most certainly set them unless the widget was created in C++ and you went out of your way to forbid its setting in blueprint (which I doubt since it is called WB…)
Can you show what is in the details panel when you select the variable in WB_CardSelectionWidget
you are trying to get?
Also can you show me what is listed when you drag the Result Value and from the drop down go to “Variables->Default” like this:
Hi, thank you for the reply.
I can confirm it was not made in c++, i never used it in this project, only blueprints.
Can you show what is in the details panel when you select the variable in
WB_CardSelectionWidget
you are trying to get?
I’m sorry but it didn’t get what you mean by this, i attached some pictures i hope there is the right one.
This is what is listed from the return node, i’m missing the default dropdown too, the only similar thing i found was this but only gets no sets:
the details page when pressing on Create WB Card Selection Widget
and the details page of the WB_CardSelectionWidget
blueprint:
Ok… That’s good. What you see there are all your components that you have set as variables. You can get “machineNameText” for example and drag a “SetText(Text)” node from it.
If I were you I would just create a S_Unit1
variable in WB_CardSelectionWidget
and expose it on spawn:
Pass it when I create the widget:
And use the construct event to set all my variables or bind them directly:
But that’s just me. You have your components exposed so you can have them set in the loop if you wish.
thank you, trying to follow what you suggested (if i got it right) I added the Structure to the tried to WB_CardSelectionWidget
so that when i’m creating it inside the WB_MSelection
Widget i can pass the corresponding one and then the widget sets the variables inside the contruct event, but inside the construct event of the WB_CardSelectionWidget
I can’t set variables… i don’t know if it’s me that I’m not understanding it or else…
This is the construct script inside the WB_CardSelectionWidget
the set option is not available:
This is the WB_MSelection
where i just added the link to pass the Structure S Unit
sunit
is already set in your WB_MSelection when you passed it in the Create node. You don’t have to set it again
Just use it:
Ok i got the way it shoudl work, my only problem now is that i can’t set this variables inside the WB_CardSelectionWidget. i tried making a setter and it says it's read only. this happens for all but the
S unit`. How can i set it to editable? i can’t press the eye or anything else, is there a setting i should change? btw i’m on UE 5.4.3
I’m sorry but I don’t get where you got that set text function, could you the way to set the variables of the elements of the blueprint from the construct event? I have my text set as a variable but no set text function. That’s what I don’t get
ok i managed to get how to set the text by also watching this video. Is it possible to also set images? i couldn’t find a node for that
Yep. The node name is SetBrushFromTexture
.
Ok thank you, i marked as resolved but havw 2 final questions:
1 Where can i learn more about this topic? like where did you find how the nodes are called?
2 how can i set the location for the widget? i tried to use the set position in viewport but didn’t work. i found that the Make widget transform works
so this is not an issue anymore
3 is using “add child to canvas” the right way of adding the new widget to it?
Thank you
4 The text on the widget is in the wrong position, the image is not, why does this happen?
- You can see all available nodes when you right click in your blueprint and remove the “Context Sensitive” checkbox at the top. Some of the nodes are unintuitive but you can check Mathew Wadstein tutorials for most of them: https://www.youtube.com/@MathewWadsteinTutorials Other than that, the more practice you have the more you’ll know what to use and when.
- Make a widget with a canvas. In the canvas you can set the position of the internal widgets. https://www.youtube.com/watch?v=s-UKj9bkUuI
- Usually widgets are just added to the viewport with “Add to Viewport” node.
- I’m not sure. When you make a widget start dragging the size of the window around to see how it responds to different sizes. There are a lot of settings in the text that are responsible for the position - see the alignment and the padding values.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.