pub struct LuaStyle;Expand description
Style of a GUI element. All of the attributes listed here may be nil if not available for a particular GUI element.
Implementations§
Source§impl LuaStyle
impl LuaStyle
pub fn badge_font(&self) -> &str
pub fn badge_horizontal_spacing(&self) -> i32
Sourcepub fn bottom_cell_padding(&self) -> i16
pub fn bottom_cell_padding(&self) -> i16
Space between the table cell contents bottom and border.
pub fn bottom_margin(&self) -> i16
pub fn bottom_padding(&self) -> i16
Sourcepub fn cell_padding(&self) -> LuaAny
pub fn cell_padding(&self) -> LuaAny
Space between the table cell contents and border. Sets top/right/bottom/left cell paddings to this value.
pub fn clicked_font_color(&self) -> Color
pub fn clicked_vertical_offset(&self) -> u32
pub fn color(&self) -> Color
Sourcepub fn column_alignments(&self) -> LuaAny
pub fn column_alignments(&self) -> LuaAny
Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:
pub fn default_badge_font_color(&self) -> Color
pub fn disabled_badge_font_color(&self) -> Color
pub fn disabled_font_color(&self) -> Color
pub fn draw_grayscale_picture(&self) -> bool
pub fn extra_bottom_margin_when_activated(&self) -> i32
pub fn extra_bottom_padding_when_activated(&self) -> i32
pub fn extra_left_margin_when_activated(&self) -> i32
pub fn extra_left_padding_when_activated(&self) -> i32
Sourcepub fn extra_margin_when_activated(&self) -> LuaAny
pub fn extra_margin_when_activated(&self) -> LuaAny
Sets extra_top/right/bottom/left_margin_when_activated to this value.
An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively.
Sourcepub fn extra_padding_when_activated(&self) -> LuaAny
pub fn extra_padding_when_activated(&self) -> LuaAny
Sets extra_top/right/bottom/left_padding_when_activated to this value.
An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively.
pub fn extra_right_margin_when_activated(&self) -> i32
pub fn extra_right_padding_when_activated(&self) -> i32
pub fn extra_top_margin_when_activated(&self) -> i32
pub fn extra_top_padding_when_activated(&self) -> i32
pub fn font(&self) -> &str
pub fn font_color(&self) -> Color
Sourcepub fn gui(&self) -> LuaGui
pub fn gui(&self) -> LuaGui
Gui of the LuaGuiElement of this style.
Sourcepub fn horizontal_align(&self) -> LuaStyleHorizontalAlign
pub fn horizontal_align(&self) -> LuaStyleHorizontalAlign
Horizontal align of the inner content of the widget, if any.
Sourcepub fn horizontal_spacing(&self) -> i32
pub fn horizontal_spacing(&self) -> i32
Horizontal space between individual cells.
Sourcepub fn horizontally_squashable(&self) -> bool
pub fn horizontally_squashable(&self) -> bool
Whether the GUI element can be squashed (by maximal width of some parent element) horizontally. nil if this element does not support squashing.
This is mainly meant to be used for scroll-pane. The default value is false.
Sourcepub fn horizontally_stretchable(&self) -> bool
pub fn horizontally_stretchable(&self) -> bool
Whether the GUI element stretches its size horizontally to other elements. nil if this element does not support stretching.
pub fn hovered_font_color(&self) -> Color
Sourcepub fn left_cell_padding(&self) -> i16
pub fn left_cell_padding(&self) -> i16
Space between the table cell contents left and border.
pub fn left_margin(&self) -> i16
pub fn left_padding(&self) -> i16
Sourcepub fn margin(&self) -> LuaAny
pub fn margin(&self) -> LuaAny
Sets top/right/bottom/left margins to this value.
An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively.
Sourcepub fn maximal_height(&self) -> i32
pub fn maximal_height(&self) -> i32
Maximal height ensures, that the widget will never be bigger than than that size. It can’t be stretched to be bigger.
Sourcepub fn maximal_width(&self) -> i32
pub fn maximal_width(&self) -> i32
Maximal width ensures, that the widget will never be bigger than than that size. It can’t be stretched to be bigger.
Sourcepub fn minimal_height(&self) -> i32
pub fn minimal_height(&self) -> i32
Minimal height ensures, that the widget will never be smaller than than that size. It can’t be squashed to be smaller.
Sourcepub fn minimal_width(&self) -> i32
pub fn minimal_width(&self) -> i32
Minimal width ensures, that the widget will never be smaller than than that size. It can’t be squashed to be smaller.
Sourcepub fn natural_height(&self) -> i32
pub fn natural_height(&self) -> i32
Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.
Sourcepub fn natural_width(&self) -> i32
pub fn natural_width(&self) -> i32
Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn padding(&self) -> LuaAny
pub fn padding(&self) -> LuaAny
Sets top/right/bottom/left paddings to this value.
An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively.
pub fn pie_progress_color(&self) -> Color
Sourcepub fn rich_text_setting(&self) -> &str
pub fn rich_text_setting(&self) -> &str
How this GUI element handles rich text.
Sourcepub fn right_cell_padding(&self) -> i16
pub fn right_cell_padding(&self) -> i16
Space between the table cell contents right and border.
pub fn right_margin(&self) -> i16
pub fn right_padding(&self) -> i16
pub fn selected_badge_font_color(&self) -> Color
pub fn selected_clicked_font_color(&self) -> Color
pub fn selected_font_color(&self) -> Color
pub fn selected_hovered_font_color(&self) -> Color
pub fn single_line(&self) -> bool
Sourcepub fn size(&self) -> LuaAny
pub fn size(&self) -> LuaAny
Sets both width and height to the given value. Also accepts an array with two values, setting width to the first and height to the second one.
pub fn stretch_image_to_widget_size(&self) -> bool
pub fn strikethrough_color(&self) -> Color
Sourcepub fn top_cell_padding(&self) -> i16
pub fn top_cell_padding(&self) -> i16
Space between the table cell contents top and border.
pub fn top_margin(&self) -> i16
pub fn top_padding(&self) -> i16
pub fn use_header_filler(&self) -> bool
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn vertical_align(&self) -> LuaStyleVerticalAlign
pub fn vertical_align(&self) -> LuaStyleVerticalAlign
Vertical align of the inner content of the widget, if any.
Sourcepub fn vertical_spacing(&self) -> i32
pub fn vertical_spacing(&self) -> i32
Vertical space between individual cells.
Sourcepub fn vertically_squashable(&self) -> bool
pub fn vertically_squashable(&self) -> bool
Whether the GUI element can be squashed (by maximal height of some parent element) vertically. nil if this element does not support squashing.
This is mainly meant to be used for scroll-pane. The default (parent) value for scroll pane is true, false otherwise.
Sourcepub fn vertically_stretchable(&self) -> bool
pub fn vertically_stretchable(&self) -> bool
Whether the GUI element stretches its size vertically to other elements. nil if this element does not support stretching.
Sourcepub fn get_style(
&self,
create: Option<bool>,
style_name: &str,
) -> Option<LuaStyle>
pub fn get_style( &self, create: Option<bool>, style_name: &str, ) -> Option<LuaStyle>
Gets the given sub-style of this style if it exists. See StyleSpecification types for what sub styles are usable.
Note: when creating sub-styles they have no set values and have the parent set to the styles top-level default.
Note: when the parent LuaGuiElement::style is directly changed (element.style = “new_style”) any sub-styles will be invalidated.