crystal.Joint
Joints define how a UI element should be laid out by its parent. Different types of containers and wrappers use different types of joint with options relevant to them like padding or alignment. This is the base class for all joint types.
Constructor
Joint are created by calling add_child or set_child. The type of joint being created depends on the type of the container/wrapper.
Methods
| Name | Description |
|---|---|
| child | Returns the child this joint is affecting. |
| parent | Returns the container or wrapper the child element is in. |
Examples
local overlay = crystal.Overlay:new();
local image = overlay:add_child(crystal.Image:new());
assert(image:joint():child() == image);
assert(image:joint():parent() == overlay);