Announcement

Collapse
No announcement yet.

Widget Buttons transform to text only after shuffle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Widget Buttons transform to text only after shuffle

    Hi everyone, I'm having so issue with a widget blueprint.
    I'm doing a Multiple Choice Questions in VR. Questions and answers are picked from a data table where the right answer (Réponse Juste in french) is always in the third column. (Data Table is a csv from an Exel File made by people who never and will never use Unreal).
    Click image for larger version

Name:	forum1.png
Views:	8
Size:	91.7 KB
ID:	1626127
    I made a widget blueprint with the question and the answers. Answers are another widget wich contains a button and a text, whear I set up the vr interactivity with the player. I did it this way so I can re-use this widget in other widgets which need interactivity.
    Click image for larger version

Name:	forum2.png
Views:	5
Size:	159.6 KB
ID:	1626128
    Click image for larger version

Name:	forum3.png
Views:	4
Size:	204.8 KB
ID:	1626131

    Everything work fine exept the right answer is always the first one. So I made a little script to randomize the answers. That worked pretty well with button within the widget, but when I use my external button widget, all text are on top of each other and there's no background button, padding or margin.
    Here's the script:
    Click image for larger version

Name:	forum4.png
Views:	5
Size:	162.5 KB
ID:	1626132

    Result without shuffle:
    Click image for larger version

Name:	forum5.jpg
Views:	3
Size:	166.5 KB
ID:	1626133

    Result with shuffle:
    Click image for larger version

Name:	forum6.jpg
Views:	3
Size:	227.9 KB
ID:	1626134

    I don't undersant why the button is just a text and not a button anymore...

    Therefore I need some help
    Attached Files

    #2
    The fill and alignment settings are stored in the child slot, not on the child widget itself. When you removed the widgets from their parent panel, the slot settings are gone. You need to take the output from AddChild, cast to VerticalBoxSlot, then call the functions to set the alignment to the values you want.

    Comment


      #3
      Originally posted by Manoel.Neto View Post
      The fill and alignment settings are stored in the child slot, not on the child widget itself. When you removed the widgets from their parent panel, the slot settings are gone. You need to take the output from AddChild, cast to VerticalBoxSlot, then call the functions to set the alignment to the values you want.

      Thank you very much, you save my day!!!!
      Here's the final script:

      Comment

      Working...
      X