UIElement:set_focusable

Sets whether this element is focusable.

This method should be used to govern whether an element can ever receive focus, and should not be called outside initialization. To temporarily allow or prevent an element from receiving focus, see set_active.

This method does not retroactively clear focus when making a focused element unfocusable.

Usage

ui_element:set_focusable(focusable)

Returns

Name Type Description
focusable boolean True if the element should be focusable, false otherwise.

Examples

local menu = crystal.Overlay:new();
menu:set_focusable(true);
print(menu:is_focusable()); -- Prints "true"

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