Move children Image() objects along with the parent object

i add Image() objects to a parent Widget() with parent_widget.add_widget(Image()). Image objects have a image texture which works ok. But the issue is that I would like them all to move when I move the parent Widget.

Is there an easy solution for this? For now I have ended up looping through all child objects of the parent and repositioning them with offset values.

I use no kv file, purely Python.

Upvotes: 0

Views: 152

Answers (1)

inclement
inclement

Reputation: 29488

You should use a layout class instead of a Widget, this is the point of them. For instance, if you want them stacked horizontally and vertically to fill the available space you could use a BoxLayout.

Upvotes: 1

Related Questions