Skip to main content

LuaStyle

Struct LuaStyle 

Source
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

Source

pub fn badge_font(&self) -> &'static str

Source

pub fn set_badge_font(&self, value: &'static str)

Set the badge_font attribute (Lua: self.badge_font = value).

Source

pub fn badge_horizontal_spacing(&self) -> i32

Source

pub fn set_badge_horizontal_spacing(&self, value: i32)

Set the badge_horizontal_spacing attribute (Lua: self.badge_horizontal_spacing = value).

Source

pub fn bar_width(&self) -> u32

The thickness of the bar, not the horizontal width.

Source

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.

Source

pub fn bottom_cell_padding(&self) -> i16

Space between the table cell contents bottom and border.

Source

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.

Source

pub fn bottom_margin(&self) -> i16

Source

pub fn set_bottom_margin(&self, value: i16)

Set the bottom_margin attribute (Lua: self.bottom_margin = value).

Source

pub fn bottom_padding(&self) -> i16

Source

pub fn set_bottom_padding(&self, value: i16)

Set the bottom_padding attribute (Lua: self.bottom_padding = value).

Source

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.

Source

pub fn clicked_font_color(&self) -> Color

Source

pub fn set_clicked_font_color(&self, value: Color)

Set the clicked_font_color attribute (Lua: self.clicked_font_color = value).

Source

pub fn clicked_vertical_offset(&self) -> u32

Source

pub fn set_clicked_vertical_offset(&self, value: u32)

Set the clicked_vertical_offset attribute (Lua: self.clicked_vertical_offset = value).

Source

pub fn color(&self) -> Color

Source

pub fn set_color(&self, value: Color)

Set the color attribute (Lua: self.color = value).

Source

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:

Source

pub fn default_badge_font_color(&self) -> Color

Source

pub fn set_default_badge_font_color(&self, value: Color)

Set the default_badge_font_color attribute (Lua: self.default_badge_font_color = value).

Source

pub fn disabled_badge_font_color(&self) -> Color

Source

pub fn set_disabled_badge_font_color(&self, value: Color)

Set the disabled_badge_font_color attribute (Lua: self.disabled_badge_font_color = value).

Source

pub fn disabled_font_color(&self) -> Color

Source

pub fn set_disabled_font_color(&self, value: Color)

Set the disabled_font_color attribute (Lua: self.disabled_font_color = value).

Source

pub fn draw_grayscale_picture(&self) -> bool

Source

pub fn set_draw_grayscale_picture(&self, value: bool)

Set the draw_grayscale_picture attribute (Lua: self.draw_grayscale_picture = value).

Source

pub fn extra_bottom_margin_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_bottom_padding_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_left_margin_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_left_padding_when_activated(&self) -> i32

Source

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).

Source

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.

Source

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.

Source

pub fn extra_right_margin_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_right_padding_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_top_margin_when_activated(&self) -> i32

Source

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).

Source

pub fn extra_top_padding_when_activated(&self) -> i32

Source

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).

Source

pub fn font(&self) -> &'static str

Source

pub fn set_font(&self, value: &'static str)

Set the font attribute (Lua: self.font = value).

Source

pub fn font_color(&self) -> Color

Source

pub fn set_font_color(&self, value: Color)

Set the font_color attribute (Lua: self.font_color = value).

Source

pub fn gui(&self) -> LuaGui

Gui of the LuaGuiElement of this style.

Source

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.

Source

pub fn horizontal_align(&self) -> LuaStyleHorizontalAlign

Horizontal align of the inner content of the widget, if any.

Source

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.

Source

pub fn horizontal_spacing(&self) -> i32

Horizontal space between individual cells.

Source

pub fn set_horizontal_spacing(&self, value: i32)

Set the horizontal_spacing attribute (Lua: self.horizontal_spacing = value).

Horizontal space between individual cells.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn hovered_font_color(&self) -> Color

Source

pub fn set_hovered_font_color(&self, value: Color)

Set the hovered_font_color attribute (Lua: self.hovered_font_color = value).

Source

pub fn left_cell_padding(&self) -> i16

Space between the table cell contents left and border.

Source

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.

Source

pub fn left_margin(&self) -> i16

Source

pub fn set_left_margin(&self, value: i16)

Set the left_margin attribute (Lua: self.left_margin = value).

Source

pub fn left_padding(&self) -> i16

Source

pub fn set_left_padding(&self, value: i16)

Set the left_padding attribute (Lua: self.left_padding = value).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn name(&self) -> &'static str

Name of this style.

Source

pub fn set_name(&self, value: &'static str)

Set the name attribute (Lua: self.name = value).

Name of this style.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn pie_progress_color(&self) -> Color

Source

pub fn set_pie_progress_color(&self, value: Color)

Set the pie_progress_color attribute (Lua: self.pie_progress_color = value).

Source

pub fn rich_text_setting(&self) -> &'static str

How this GUI element handles rich text.

Source

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.

Source

pub fn right_cell_padding(&self) -> i16

Space between the table cell contents right and border.

Source

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.

Source

pub fn right_margin(&self) -> i16

Source

pub fn set_right_margin(&self, value: i16)

Set the right_margin attribute (Lua: self.right_margin = value).

Source

pub fn right_padding(&self) -> i16

Source

pub fn set_right_padding(&self, value: i16)

Set the right_padding attribute (Lua: self.right_padding = value).

Source

pub fn selected_badge_font_color(&self) -> Color

Source

pub fn set_selected_badge_font_color(&self, value: Color)

Set the selected_badge_font_color attribute (Lua: self.selected_badge_font_color = value).

Source

pub fn selected_clicked_font_color(&self) -> Color

Source

pub fn set_selected_clicked_font_color(&self, value: Color)

Set the selected_clicked_font_color attribute (Lua: self.selected_clicked_font_color = value).

Source

pub fn selected_font_color(&self) -> Color

Source

pub fn set_selected_font_color(&self, value: Color)

Set the selected_font_color attribute (Lua: self.selected_font_color = value).

Source

pub fn selected_hovered_font_color(&self) -> Color

Source

pub fn set_selected_hovered_font_color(&self, value: Color)

Set the selected_hovered_font_color attribute (Lua: self.selected_hovered_font_color = value).

Source

pub fn single_line(&self) -> bool

Source

pub fn set_single_line(&self, value: bool)

Set the single_line attribute (Lua: self.single_line = value).

Source

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.

Source

pub fn stretch_image_to_widget_size(&self) -> bool

Source

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).

Source

pub fn strikethrough_color(&self) -> Color

Source

pub fn set_strikethrough_color(&self, value: Color)

Set the strikethrough_color attribute (Lua: self.strikethrough_color = value).

Source

pub fn top_cell_padding(&self) -> i16

Space between the table cell contents top and border.

Source

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.

Source

pub fn top_margin(&self) -> i16

Source

pub fn set_top_margin(&self, value: i16)

Set the top_margin attribute (Lua: self.top_margin = value).

Source

pub fn top_padding(&self) -> i16

Source

pub fn set_top_padding(&self, value: i16)

Set the top_padding attribute (Lua: self.top_padding = value).

Source

pub fn use_header_filler(&self) -> bool

Source

pub fn set_use_header_filler(&self, value: bool)

Set the use_header_filler attribute (Lua: self.use_header_filler = value).

Source

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.

Source

pub fn vertical_align(&self) -> LuaStyleVerticalAlign

Vertical align of the inner content of the widget, if any.

Source

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.

Source

pub fn vertical_spacing(&self) -> i32

Vertical space between individual cells.

Source

pub fn set_vertical_spacing(&self, value: i32)

Set the vertical_spacing attribute (Lua: self.vertical_spacing = value).

Vertical space between individual cells.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for LuaStyle

Source§

fn clone(&self) -> LuaStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LuaStyle

Source§

impl Debug for LuaStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LuaStyle

Source§

fn default() -> LuaStyle

Returns the “default value” for a type. Read more
Source§

impl Eq for LuaStyle

Source§

impl From<LuaStyle> for LuaAny

Source§

fn from(_: LuaStyle) -> Self

Converts to this type from the input type.
Source§

impl LuaObject for LuaStyle

Source§

impl PartialEq for LuaStyle

Source§

fn eq(&self, other: &LuaStyle) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LuaStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.