1
Graphics / Re: SFML Drawing Hierarchies
« on: December 26, 2018, 05:41:10 pm »
Hello,
well, why not just use absolute coordinates (which you have to) but hide it as much as possible? For example, if you construct the child widget:
Widget* child = new ChildWidget (myCoordinates + relativeCoordinates);
You could also implement a move () function, which you pass relative coordinates to, and then, if your parent widget gets moved, you just call move() with the exact same vector.
well, why not just use absolute coordinates (which you have to) but hide it as much as possible? For example, if you construct the child widget:
Widget* child = new ChildWidget (myCoordinates + relativeCoordinates);
You could also implement a move () function, which you pass relative coordinates to, and then, if your parent widget gets moved, you just call move() with the exact same vector.