Page 1 of 1

drawable groups

Posted: Fri Jan 03, 2020 11:46 pm
by uSources
Hello everyone, I would like to know if there is any way to create a like a 'parent object' which allows you to have children drawables objects and move them together. Like a Unity GameObject or Godot Nodes, witch allow to group multiple object and move together

Thanks!!

Re: drawable groups

Posted: Sat Jan 04, 2020 7:41 am
by raidho36
You can stack transformations, when applied to graphics the effect will be exactly like this. You can retrieve specific transformation at any stage and use it for other calculations such as physics and mouse clicks and whatnot.

Look for Transform class in love.math module.

Re: drawable groups

Posted: Sat Jan 04, 2020 10:39 am
by pgimeno
There's also a scene graph library if you prefer to do things that way. https://love2d.org/forums/viewtopic.php?f=5&t=85947