So I’m making a deck building game heavily inspired by Ascension, but I’m having trouble with some stuff. I’m using a horizontal box to store the cards in their respective rows, but I can’t get the card to slide over to where it needs to go when it’s played, acquired, etc. Removing the card from the box and making it a child puts it in the top left corner, and the size of the card resets.
To set the position of the card when clicked I tried doing something like:
Vector2D var = card.GetAsCanvas().GetPosition()
card.RemoveFromParent()
canvas.AddChild(card)
card.GetAsCanvas().SetPosition(var)
But for most variables in the card’s canvas when it’s in an HBox is 0 instead of what it looks like on the screen.
To get it to go where it needs to go, I’m assuming I can just set up the Tick function of the card to check if it has to go somewhere, and if it does, lerp towards that location, and when it reaches it, set it as a child of that HBox. I haven’t actually tried this though because I can’t get it to start at the right location.
Also, I’d like the card to grow bigger when you mouse over it, but that messes with the size of the other stuff in the HBox. I’m thinking I’ll just make another Widget that is invisible unless we’re over a card, and it sets it’s image as that card and moves itself to the right location, etc. but that seems like an ugly solution.
And lastly, if anyone here has played Ascension, when there’s a row to show with too many cards, it stacks the cards on the leftmost side top of each other. Does anyone know if you can do that with the HBox, or will I have to create some sort of custom container to do this?
Thanks in advance for any advice