0 votes

Is it possible to align area2D instanced nodes using control nodes like margin container or centre container ?
There are couple of cards (Area2D with a Sprite) that are being instanced through code at position 2d, I am desiring to have those cards spread out with some offset and position 2d as centre, so I tried

for i in range(cards.get_child_count()):
    cards.get_child(i).position = Vector 2(30,0) * i

But in this case the cards spread out with the first card being at position 2d which is not as desired. So, can centre container be used to align the instanced cards .
Any help ?

in Engine by (44 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.