The 'Anchor' class is used to anchor one object to some position
inside another object. It seemed like a simple alternative to
implementing a layout manager. Though it is more limited...
Each Class that inherits from CGUI contains an anchor object.
For instance, you can add a button to a frame then anchor the
button to the bottom left corner of the frame.
Description: Produce a string representation of this anchor.
useful for debugging.
Description: Check to see if this anchor has been set
Description: Set this anchor.
Continuing the setAnchor (frame, "left", "15", "bottom", "-15")
would anchor the object(the button)
Description: Adjust the X position of this anchor
Continuing from setAnchor: adjustAnchor ("right", "-15")
would move the object to the right side, where it was on the left
and it would now be offset 15 to the left of the right edge.
Description: adjust the Y position of this anchor
Continuing from setAnchor: adjustAnchor ("top", "15")
would move the object to the top edge, where it was on the bottom
and it would now be offset 15 down from the top edge.
Description: adjust this anchor.
The adjustAnchor method goes through and resets the x and y
coordinates of the anchors parent so that it is now in the right
position relative to the anchorTo object.
- so it adjusts the buttons x,y values so that the button is
now in the appropriate position relative to the Frame.