Announcement

Collapse
No announcement yet.

Widget Problem: Child Widget Alignment

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

    Widget Problem: Child Widget Alignment

    Hi, I have a tricky problem:

    I have an overlay in a widget where I want to add a child.
    This child is another widget. The logic itself works wonderfully,
    the child is added and removed.






    Now the problem:

    If the child widget is created and added to the overlay,
    it will not be fully aligned. The alignment is at the default setting (top-left alignment).





    But I want it to be aligned that way (when it gets added as child):





    What do I overlook? I already tried to set the alignment via blueprints, which does not work.

    Question: Is it possible to control the alignment differently than manually?

    In Blueprints.



    I would appreciate an answer.

    #2
    When you add a child to certain containers, you can either treat those container as generic panels or specific ones. Have a closer look at the targets on the Add Child nodes below:

    Click image for larger version

Name:	Capture.PNG
Views:	577
Size:	110.0 KB
ID:	1468306

    The top row is using the same method as you are; however, since the container type is not specified here (Target is Panel Widget), you will need to cast first. Only then can the child be treated as an OverlaySlot and its alignment set.
    The bottom row shows the child being added to the overlay panel directly (Target is Overlay). In this instance, the return type is already an Overlay and casting is no longer necessary.

    In your case it seems that using the Add Child to Overlay node should do the trick:

    Click image for larger version

Name:	Capture2.PNG
Views:	550
Size:	22.1 KB
ID:	1468307

    Comment


      #3
      Sir, you are my HERO!

      I would like to kiss your feet, because

      I was about to throw the whole system overboard.

      You really saved my day, no you saved my year!

      Thank you so much, I was really desperate.

      My best regards.

      Comment


        #4
        This was the first question I asked on the Answer Hub. Oct 2014 *sheds a tear*

        Comment

        Working...
        X