How do I overlap images in a Vertical Layout Group?

Greetings!

Essentially, I have a panel with a vertical layout group in which you can drop cards. What I want to do is overlap cards. So let’s say I drag the first card onto that panel. Now I’m going to drag a second one. This second one will stay on top of the first card, though not completely, as I want the top of the first card to be visible. I’ve looked around to see if I could figure it out but no luck. How can this be done?

Here’s a quick illustration:

Thanks in advance,

  • Nervly

Well you could have the direct child of the layout group to be just the size that should be shown (the area with the text), and then add a Child panel that has negative padding at the bottom, like this:

The Spacing variable of Vertical Layout Group can be set to negative to force children to overlap. Child Force Expand (which evenly spaces out children) and Child Controls Size (which stretches children) should be disabled.

3 Likes