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) -> &str

Source

pub fn badge_horizontal_spacing(&self) -> i32

Source

pub fn bar_width(&self) -> u32

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 bottom_margin(&self) -> i16

Source

pub fn bottom_padding(&self) -> i16

Source

pub fn cell_padding(&self) -> LuaAny

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 clicked_vertical_offset(&self) -> u32

Source

pub fn color(&self) -> Color

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 disabled_badge_font_color(&self) -> Color

Source

pub fn disabled_font_color(&self) -> Color

Source

pub fn draw_grayscale_picture(&self) -> bool

Source

pub fn extra_bottom_margin_when_activated(&self) -> i32

Source

pub fn extra_bottom_padding_when_activated(&self) -> i32

Source

pub fn extra_left_margin_when_activated(&self) -> i32

Source

pub fn extra_left_padding_when_activated(&self) -> i32

Source

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.

Source

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.

Source

pub fn extra_right_margin_when_activated(&self) -> i32

Source

pub fn extra_right_padding_when_activated(&self) -> i32

Source

pub fn extra_top_margin_when_activated(&self) -> i32

Source

pub fn extra_top_padding_when_activated(&self) -> i32

Source

pub fn font(&self) -> &str

Source

pub fn font_color(&self) -> Color

Source

pub fn gui(&self) -> LuaGui

Gui of the LuaGuiElement of this style.

Source

pub fn height(&self) -> LuaAny

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 horizontal_spacing(&self) -> i32

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 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 hovered_font_color(&self) -> Color

Source

pub fn left_cell_padding(&self) -> i16

Space between the table cell contents left and border.

Source

pub fn left_margin(&self) -> i16

Source

pub fn left_padding(&self) -> i16

Source

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.

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 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 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 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 name(&self) -> &str

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

Source

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.

Source

pub fn pie_progress_color(&self) -> Color

Source

pub fn rich_text_setting(&self) -> &str

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 right_margin(&self) -> i16

Source

pub fn right_padding(&self) -> i16

Source

pub fn selected_badge_font_color(&self) -> Color

Source

pub fn selected_clicked_font_color(&self) -> Color

Source

pub fn selected_font_color(&self) -> Color

Source

pub fn selected_hovered_font_color(&self) -> Color

Source

pub fn single_line(&self) -> bool

Source

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.

Source

pub fn stretch_image_to_widget_size(&self) -> bool

Source

pub fn strikethrough_color(&self) -> Color

Source

pub fn top_cell_padding(&self) -> i16

Space between the table cell contents top and border.

Source

pub fn top_margin(&self) -> i16

Source

pub fn top_padding(&self) -> i16

Source

pub fn use_header_filler(&self) -> bool

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 vertical_spacing(&self) -> i32

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 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 width(&self) -> LuaAny

Sets both minimal and maximal width to the given value.

Source

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.

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.