UIElement:set_rotation

Sets this element’s rotation angle. Rotation is always applied around the element’s pivot.

Rotation does not affect an element’s layout, it is only a visual effect.

Usage

ui_element:set_rotation(angle)

Arguments

Name Type Description
angle number Rotation angle in radians.

Examples

local image = crystal.Image:new(crystal.assets.get("sword.png"));
image:set_rotation(math.pi);
print(image:rotation()); -- Prints "3.1415..."

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