crystal.Padding

Utility class storing up/down/left/right padding amounts. This is often used by Joint subclasses, and rarely instantiated directly in game code.

Constructor

crystal.Padding:new()

Methods

Name Description
padding_bottom Returns the bottom padding amount.
padding_left Returns the left padding amount.
padding_right Returns the right padding amount.
padding_top Returns the top padding amount.
padding Returns all four padding amounts.
set_padding_bottom Sets the bottom padding amount.
set_padding_left Sets the left padding amount.
set_padding_right Sets the right padding amount.
set_padding_top Sets the top padding amount.
set_padding_x Sets the left and right padding amounts.
set_padding_y Sets the top and bottom padding amounts.
set_padding Sets all four padding amounts.

Examples

In this example, an Image is added to an Overlay container. Overlay containers use BasicJoint to configure their children, and [BasicJoint] transparently exposes a Padding object.

local overlay = crystal.Overlay:new();
local image = overlay:add_child(crystal.Image:new());
image:set_padding_x(20);

This site uses Just the Docs, a documentation theme for Jekyll.