You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to piccolo...@googlegroups.com
Hello Piccolos I've got a question about moving Nodes around. When I do that interactively e.g. by dragging a node, Piccolo takes care about moving all the node's children respectively. However, if I move a Node programmatically by calling setX(), setY(), or setBounds(), the child nodes keep their positions unchanged. So currently I always add some code which adapts the childrens' positions as well. But before I spread this pattern all over a more sophisticated application's code, I'd rather like to ask if there is already something around which applies a node movement recursively to all its children. I couldn't find any corresponding example or a method with a name which implies that kind of functionality.
Regards, Jan
Lalit Pant
unread,
Apr 22, 2014, 10:18:00 PM4/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to piccolo...@googlegroups.com
You can try setOffset(x, y) or translate(dx, dy). That affects the node's transform, so all child nodes will be similarly affected.
Cheers, - Lalit
Michael Heuer
unread,
Apr 22, 2014, 10:41:46 PM4/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to piccolo...@googlegroups.com
Good advice, Lalit.
This doc here explains some of the more non-obvious aspects of the
Piccolo2D library design
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to piccolo...@googlegroups.com
I have a hierarchy of nodes in which I have to inform the children that their parent's bounds are changed so they have to update their bounds relative to their parents. While reading the setbounds source code I realized that there is a method named parentBoundsChanged which you can override so that the children nodes become aware of this change and can update their bounds to new position. I thought this may be helpful for you.