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) -> &'static str
Sourcepub fn set_badge_font(&self, value: &'static str)
pub fn set_badge_font(&self, value: &'static str)
Set the badge_font attribute (Lua: self.badge_font = value).
pub fn badge_horizontal_spacing(&self) -> i32
Sourcepub fn set_badge_horizontal_spacing(&self, value: i32)
pub fn set_badge_horizontal_spacing(&self, value: i32)
Set the badge_horizontal_spacing attribute (Lua: self.badge_horizontal_spacing = value).
Sourcepub fn set_bar_width(&self, value: u32)
pub fn set_bar_width(&self, value: u32)
Set the bar_width attribute (Lua: self.bar_width = value).
The thickness of the bar, not the horizontal width.
Sourcepub fn bottom_cell_padding(&self) -> i16
pub fn bottom_cell_padding(&self) -> i16
Space between the table cell contents bottom and border.
Sourcepub fn set_bottom_cell_padding(&self, value: i16)
pub fn set_bottom_cell_padding(&self, value: i16)
Set the bottom_cell_padding attribute (Lua: self.bottom_cell_padding = value).
Space between the table cell contents bottom and border.
pub fn bottom_margin(&self) -> i16
Sourcepub fn set_bottom_margin(&self, value: i16)
pub fn set_bottom_margin(&self, value: i16)
Set the bottom_margin attribute (Lua: self.bottom_margin = value).
pub fn bottom_padding(&self) -> i16
Sourcepub fn set_bottom_padding(&self, value: i16)
pub fn set_bottom_padding(&self, value: i16)
Set the bottom_padding attribute (Lua: self.bottom_padding = value).
Sourcepub fn set_cell_padding(&self, value: i16)
pub fn set_cell_padding(&self, value: i16)
Set the cell_padding attribute (Lua: self.cell_padding = value).
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
Sourcepub fn set_clicked_font_color(&self, value: Color)
pub fn set_clicked_font_color(&self, value: Color)
Set the clicked_font_color attribute (Lua: self.clicked_font_color = value).
pub fn clicked_vertical_offset(&self) -> u32
Sourcepub fn set_clicked_vertical_offset(&self, value: u32)
pub fn set_clicked_vertical_offset(&self, value: u32)
Set the clicked_vertical_offset attribute (Lua: self.clicked_vertical_offset = value).
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
Sourcepub fn set_default_badge_font_color(&self, value: Color)
pub fn set_default_badge_font_color(&self, value: Color)
Set the default_badge_font_color attribute (Lua: self.default_badge_font_color = value).
pub fn disabled_badge_font_color(&self) -> Color
Sourcepub fn set_disabled_badge_font_color(&self, value: Color)
pub fn set_disabled_badge_font_color(&self, value: Color)
Set the disabled_badge_font_color attribute (Lua: self.disabled_badge_font_color = value).
pub fn disabled_font_color(&self) -> Color
Sourcepub fn set_disabled_font_color(&self, value: Color)
pub fn set_disabled_font_color(&self, value: Color)
Set the disabled_font_color attribute (Lua: self.disabled_font_color = value).
pub fn draw_grayscale_picture(&self) -> bool
Sourcepub fn set_draw_grayscale_picture(&self, value: bool)
pub fn set_draw_grayscale_picture(&self, value: bool)
Set the draw_grayscale_picture attribute (Lua: self.draw_grayscale_picture = value).
pub fn extra_bottom_margin_when_activated(&self) -> i32
Sourcepub fn set_extra_bottom_margin_when_activated(&self, value: i32)
pub fn set_extra_bottom_margin_when_activated(&self, value: i32)
Set the extra_bottom_margin_when_activated attribute (Lua: self.extra_bottom_margin_when_activated = value).
pub fn extra_bottom_padding_when_activated(&self) -> i32
Sourcepub fn set_extra_bottom_padding_when_activated(&self, value: i32)
pub fn set_extra_bottom_padding_when_activated(&self, value: i32)
Set the extra_bottom_padding_when_activated attribute (Lua: self.extra_bottom_padding_when_activated = value).
pub fn extra_left_margin_when_activated(&self) -> i32
Sourcepub fn set_extra_left_margin_when_activated(&self, value: i32)
pub fn set_extra_left_margin_when_activated(&self, value: i32)
Set the extra_left_margin_when_activated attribute (Lua: self.extra_left_margin_when_activated = value).
pub fn extra_left_padding_when_activated(&self) -> i32
Sourcepub fn set_extra_left_padding_when_activated(&self, value: i32)
pub fn set_extra_left_padding_when_activated(&self, value: i32)
Set the extra_left_padding_when_activated attribute (Lua: self.extra_left_padding_when_activated = value).
Sourcepub fn set_extra_margin_when_activated(&self, value: i32)
pub fn set_extra_margin_when_activated(&self, value: i32)
Set the extra_margin_when_activated attribute (Lua: self.extra_margin_when_activated = value).
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 set_extra_padding_when_activated(&self, value: i32)
pub fn set_extra_padding_when_activated(&self, value: i32)
Set the extra_padding_when_activated attribute (Lua: self.extra_padding_when_activated = value).
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
Sourcepub fn set_extra_right_margin_when_activated(&self, value: i32)
pub fn set_extra_right_margin_when_activated(&self, value: i32)
Set the extra_right_margin_when_activated attribute (Lua: self.extra_right_margin_when_activated = value).
pub fn extra_right_padding_when_activated(&self) -> i32
Sourcepub fn set_extra_right_padding_when_activated(&self, value: i32)
pub fn set_extra_right_padding_when_activated(&self, value: i32)
Set the extra_right_padding_when_activated attribute (Lua: self.extra_right_padding_when_activated = value).
pub fn extra_top_margin_when_activated(&self) -> i32
Sourcepub fn set_extra_top_margin_when_activated(&self, value: i32)
pub fn set_extra_top_margin_when_activated(&self, value: i32)
Set the extra_top_margin_when_activated attribute (Lua: self.extra_top_margin_when_activated = value).
pub fn extra_top_padding_when_activated(&self) -> i32
Sourcepub fn set_extra_top_padding_when_activated(&self, value: i32)
pub fn set_extra_top_padding_when_activated(&self, value: i32)
Set the extra_top_padding_when_activated attribute (Lua: self.extra_top_padding_when_activated = value).
pub fn font(&self) -> &'static str
pub fn font_color(&self) -> Color
Sourcepub fn set_font_color(&self, value: Color)
pub fn set_font_color(&self, value: Color)
Set the font_color attribute (Lua: self.font_color = value).
Sourcepub fn gui(&self) -> LuaGui
pub fn gui(&self) -> LuaGui
Gui of the LuaGuiElement of this style.
Sourcepub fn set_height(&self, value: i32)
pub fn set_height(&self, value: i32)
Set the height attribute (Lua: self.height = value).
Sets both minimal and maximal height to the given value.
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 set_horizontal_align(&self, value: LuaStyleHorizontalAlign)
pub fn set_horizontal_align(&self, value: LuaStyleHorizontalAlign)
Set the horizontal_align attribute (Lua: self.horizontal_align = value).
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 set_horizontal_spacing(&self, value: i32)
pub fn set_horizontal_spacing(&self, value: i32)
Set the horizontal_spacing attribute (Lua: self.horizontal_spacing = value).
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 set_horizontally_squashable(&self, value: bool)
pub fn set_horizontally_squashable(&self, value: bool)
Set the horizontally_squashable attribute (Lua: self.horizontally_squashable = value).
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.
Sourcepub fn set_horizontally_stretchable(&self, value: bool)
pub fn set_horizontally_stretchable(&self, value: bool)
Set the horizontally_stretchable attribute (Lua: self.horizontally_stretchable = value).
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 set_hovered_font_color(&self, value: Color)
pub fn set_hovered_font_color(&self, value: Color)
Set the hovered_font_color attribute (Lua: self.hovered_font_color = value).
Sourcepub fn left_cell_padding(&self) -> i16
pub fn left_cell_padding(&self) -> i16
Space between the table cell contents left and border.
Sourcepub fn set_left_cell_padding(&self, value: i16)
pub fn set_left_cell_padding(&self, value: i16)
Set the left_cell_padding attribute (Lua: self.left_cell_padding = value).
Space between the table cell contents left and border.
pub fn left_margin(&self) -> i16
Sourcepub fn set_left_margin(&self, value: i16)
pub fn set_left_margin(&self, value: i16)
Set the left_margin attribute (Lua: self.left_margin = value).
pub fn left_padding(&self) -> i16
Sourcepub fn set_left_padding(&self, value: i16)
pub fn set_left_padding(&self, value: i16)
Set the left_padding attribute (Lua: self.left_padding = value).
Sourcepub fn set_margin(&self, value: i16)
pub fn set_margin(&self, value: i16)
Set the margin attribute (Lua: self.margin = value).
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 set_maximal_height(&self, value: i32)
pub fn set_maximal_height(&self, value: i32)
Set the maximal_height attribute (Lua: self.maximal_height = value).
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 set_maximal_width(&self, value: i32)
pub fn set_maximal_width(&self, value: i32)
Set the maximal_width attribute (Lua: self.maximal_width = value).
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 set_minimal_height(&self, value: i32)
pub fn set_minimal_height(&self, value: i32)
Set the minimal_height attribute (Lua: self.minimal_height = value).
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 set_minimal_width(&self, value: i32)
pub fn set_minimal_width(&self, value: i32)
Set the minimal_width attribute (Lua: self.minimal_width = value).
Minimal width ensures, that the widget will never be smaller than than that size. It can’t be squashed to be smaller.
Sourcepub fn set_name(&self, value: &'static str)
pub fn set_name(&self, value: &'static str)
Set the name attribute (Lua: self.name = value).
Name of this style.
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 set_natural_height(&self, value: i32)
pub fn set_natural_height(&self, value: i32)
Set the natural_height attribute (Lua: self.natural_height = value).
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 set_natural_width(&self, value: i32)
pub fn set_natural_width(&self, value: i32)
Set the natural_width attribute (Lua: self.natural_width = value).
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) -> &'static str
pub fn object_name(&self) -> &'static 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 set_padding(&self, value: i16)
pub fn set_padding(&self, value: i16)
Set the padding attribute (Lua: self.padding = value).
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 set_pie_progress_color(&self, value: Color)
pub fn set_pie_progress_color(&self, value: Color)
Set the pie_progress_color attribute (Lua: self.pie_progress_color = value).
Sourcepub fn rich_text_setting(&self) -> &'static str
pub fn rich_text_setting(&self) -> &'static str
How this GUI element handles rich text.
Sourcepub fn set_rich_text_setting(&self, value: &'static str)
pub fn set_rich_text_setting(&self, value: &'static str)
Set the rich_text_setting attribute (Lua: self.rich_text_setting = value).
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.
Sourcepub fn set_right_cell_padding(&self, value: i16)
pub fn set_right_cell_padding(&self, value: i16)
Set the right_cell_padding attribute (Lua: self.right_cell_padding = value).
Space between the table cell contents right and border.
pub fn right_margin(&self) -> i16
Sourcepub fn set_right_margin(&self, value: i16)
pub fn set_right_margin(&self, value: i16)
Set the right_margin attribute (Lua: self.right_margin = value).
pub fn right_padding(&self) -> i16
Sourcepub fn set_right_padding(&self, value: i16)
pub fn set_right_padding(&self, value: i16)
Set the right_padding attribute (Lua: self.right_padding = value).
pub fn selected_badge_font_color(&self) -> Color
Sourcepub fn set_selected_badge_font_color(&self, value: Color)
pub fn set_selected_badge_font_color(&self, value: Color)
Set the selected_badge_font_color attribute (Lua: self.selected_badge_font_color = value).
pub fn selected_clicked_font_color(&self) -> Color
Sourcepub fn set_selected_clicked_font_color(&self, value: Color)
pub fn set_selected_clicked_font_color(&self, value: Color)
Set the selected_clicked_font_color attribute (Lua: self.selected_clicked_font_color = value).
pub fn selected_font_color(&self) -> Color
Sourcepub fn set_selected_font_color(&self, value: Color)
pub fn set_selected_font_color(&self, value: Color)
Set the selected_font_color attribute (Lua: self.selected_font_color = value).
pub fn selected_hovered_font_color(&self) -> Color
Sourcepub fn set_selected_hovered_font_color(&self, value: Color)
pub fn set_selected_hovered_font_color(&self, value: Color)
Set the selected_hovered_font_color attribute (Lua: self.selected_hovered_font_color = value).
pub fn single_line(&self) -> bool
Sourcepub fn set_single_line(&self, value: bool)
pub fn set_single_line(&self, value: bool)
Set the single_line attribute (Lua: self.single_line = value).
Sourcepub fn set_size(&self, value: i32)
pub fn set_size(&self, value: i32)
Set the size attribute (Lua: self.size = value).
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
Sourcepub fn set_stretch_image_to_widget_size(&self, value: bool)
pub fn set_stretch_image_to_widget_size(&self, value: bool)
Set the stretch_image_to_widget_size attribute (Lua: self.stretch_image_to_widget_size = value).
pub fn strikethrough_color(&self) -> Color
Sourcepub fn set_strikethrough_color(&self, value: Color)
pub fn set_strikethrough_color(&self, value: Color)
Set the strikethrough_color attribute (Lua: self.strikethrough_color = value).
Sourcepub fn top_cell_padding(&self) -> i16
pub fn top_cell_padding(&self) -> i16
Space between the table cell contents top and border.
Sourcepub fn set_top_cell_padding(&self, value: i16)
pub fn set_top_cell_padding(&self, value: i16)
Set the top_cell_padding attribute (Lua: self.top_cell_padding = value).
Space between the table cell contents top and border.
pub fn top_margin(&self) -> i16
Sourcepub fn set_top_margin(&self, value: i16)
pub fn set_top_margin(&self, value: i16)
Set the top_margin attribute (Lua: self.top_margin = value).
pub fn top_padding(&self) -> i16
Sourcepub fn set_top_padding(&self, value: i16)
pub fn set_top_padding(&self, value: i16)
Set the top_padding attribute (Lua: self.top_padding = value).
pub fn use_header_filler(&self) -> bool
Sourcepub fn set_use_header_filler(&self, value: bool)
pub fn set_use_header_filler(&self, value: bool)
Set the use_header_filler attribute (Lua: self.use_header_filler = value).
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 set_vertical_align(&self, value: LuaStyleVerticalAlign)
pub fn set_vertical_align(&self, value: LuaStyleVerticalAlign)
Set the vertical_align attribute (Lua: self.vertical_align = value).
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 set_vertical_spacing(&self, value: i32)
pub fn set_vertical_spacing(&self, value: i32)
Set the vertical_spacing attribute (Lua: self.vertical_spacing = value).
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 set_vertically_squashable(&self, value: bool)
pub fn set_vertically_squashable(&self, value: bool)
Set the vertically_squashable attribute (Lua: self.vertically_squashable = value).
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 set_vertically_stretchable(&self, value: bool)
pub fn set_vertically_stretchable(&self, value: bool)
Set the vertically_stretchable attribute (Lua: self.vertically_stretchable = value).
Whether the GUI element stretches its size vertically to other elements. nil if this element does not support stretching.
Sourcepub fn set_width(&self, value: i32)
pub fn set_width(&self, value: i32)
Set the width attribute (Lua: self.width = value).
Sets both minimal and maximal width to the given value.
Sourcepub fn get_style(
&self,
style_name: &'static str,
create: Option<bool>,
) -> Option<LuaStyle>
pub fn get_style( &self, style_name: &'static str, create: Option<bool>, ) -> 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.