Types/StyleSpecification: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Protected "Types/StyleSpecification": Migrated prototype doc to separate website ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(Removed old prototype docs)
Tag: Replaced
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/StyleSpecification.html https://lua-api.factorio.com/latest/types/StyleSpecification.html]
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/StyleSpecification.html https://lua-api.factorio.com/latest/types/StyleSpecification.html]


This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
 
 
A [[types/table|table]], used as a value in [[Prototype/GuiStyle]], named by the key that is used there. Prototype/GuiStyle loads one of the extensions of this prototype, depending on the specified <code>type</code>.
 
== Extensions ==
* [[Types/ActivityBarStyleSpecification]] '''activity_bar_style'''
* [[Types/EmptyWidgetStyleSpecification]] '''empty_widget_style'''
** [[Types/CameraStyleSpecification]] '''camera_style'''
** [[Types/MinimapStyleSpecification]] '''minimap_style'''
* [[Types/DropDownStyleSpecification]] '''dropdown_style'''
* [[Types/FlowStyleSpecification]] '''flow_style'''
* [[Types/FrameStyleSpecification]] '''frame_style'''
* [[Types/GlowStyleSpecification]] '''glow_style'''
* [[Types/GraphStyleSpecification]] '''graph_style'''
* [[Types/HorizontalFlowStyleSpecification]] '''horizontal_flow_style'''
* [[Types/ImageStyleSpecification]] '''image_style'''
* [[Types/LabelStyleSpecification]] '''label_style'''
* [[Types/LineStyleSpecification]] '''line_style'''
* [[Types/ListBoxStyleSpecification]] '''list_box_style'''
* [[Types/ProgressBarStyleSpecification]] '''progressbar_style'''
* [[Types/ScrollBarStyleSpecification]] <abstract>
** [[Types/HorizontalScrollBarStyleSpecification]] '''horizontal_scrollbar_style'''
** [[Types/VerticalScrollBarStyleSpecification]] '''vertical_scrollbar_style'''
* [[Types/ScrollPaneStyleSpecification]] '''scroll_pane_style'''
* [[Types/SliderStyleSpecification]] '''slider_style'''
** [[Types/DoubleSliderStyleSpecification]] '''double_slider_style'''
* [[Types/SpeechBubbleStyleSpecification]] '''speech_bubble_style'''
* [[Types/StyleWithClickableGraphicalSetSpecification]] <abstract>
** [[Types/ButtonStyleSpecification]] '''button_style'''
*** [[Types/TechnologySlotStyleSpecification]] '''technology_slot_style'''
** [[Types/CheckBoxStyleSpecification]] '''checkbox_style'''
** [[Types/RadioButtonStyleSpecification]] '''radiobutton_style'''
* [[Types/SwitchStyleSpecification]] '''switch_style'''
* [[Types/TabbedPaneStyleSpecification]] '''tabbed_pane_style'''
* [[Types/TableStyleSpecification]] '''table_style'''
* [[Types/TabStyleSpecification]] '''tab_style'''
* [[Types/TextBoxStyleSpecification]] '''textbox_style'''
* [[Types/VerticalFlowStyleSpecification]] '''vertical_flow_style'''
 
== Mandatory properties ==
 
=== type ===
'''Type''': [[Types/string|string]]
 
The type of one of the above listed extensions, this style specification is then loaded as that extension.
 
== Optional properties ==
 
=== parent ===
'''Type''': [[Types/string|string]]
 
Name of a [[Types/StyleSpecification]]. This style specification inherits all property values from the parent style specification.<br>
Styles without a parent property default to the root style for their type. The exception to this are the root styles themselves, they cannot have a parent set. Due to this, for root styles some style properties are mandatory and behavior may be unexpected, such as an element not showing up because its size defaults to 0.
 
=== horizontal_align ===
'''Type''': [[Types/string|string]]
 
'''Default''': "left"
 
Either "left", "center" or "right".
 
=== vertical_align ===
'''Type''': [[Types/string|string]]
 
'''Default''': "top"
 
Either "top", "center" or "bottom".
 
=== ignored_by_search ===
'''Type''': [[Types/bool|bool]]
 
=== never_hide_by_search ===
'''Type''': [[Types/bool|bool]]
 
=== horizontally_stretchable ===
'''Type''': [[Types/StretchRule|StretchRule]]
 
'''Default''': "auto"
 
=== vertically_stretchable ===
'''Type''': [[Types/StretchRule|StretchRule]]
 
'''Default''': "auto"
 
=== horizontally_squashable ===
'''Type''': [[Types/StretchRule|StretchRule]]
 
'''Default''': "auto"
 
=== vertically_squashable ===
'''Type''': [[Types/StretchRule|StretchRule]]
 
'''Default''': "auto"
 
=== natural_size ===
'''Type''': [[Types/uint32|uint32]] or [[Types/table|table]] of [[Types/uint32|uint32]]
 
If this is an array, the first member of the array is <code>natural_width</code> and the second is <code>natural_height</code>. Otherwise the size is both <code>natural_width</code> and <code>natural_height</code>.
 
=== size ===
'''Type''': [[Types/uint32|uint32]] or [[Types/table|table]] of [[Types/uint32|uint32]]
 
If this is an array, the first member of the array is <code>width</code> and the second is <code>height</code>. Otherwise the size is both <code>width</code> and <code>height</code>.
 
=== width ===
'''Type''': [[Types/uint32|uint32]]
 
Sets <code>minimal_width</code>, <code>maximal_width</code> and <code>natural_width</code>.
 
=== minimal_width ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
Minimal width ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller.
 
=== maximal_width ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
Maximal width ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger.
 
=== natural_width ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
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.
 
=== height ===
'''Type''': [[Types/uint32|uint32]]
 
Sets <code>minimal_height</code>, <code>maximal_height</code> and <code>natural_height</code>.
 
=== minimal_height ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
Minimal height ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller.
 
=== maximal_height ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
Maximal height ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger.
 
=== natural_height ===
'''Type''': [[Types/uint32|uint32]]
 
'''Default''': 0
 
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.
 
=== padding ===
'''Type''': [[Types/int16|int16]]
 
Sets <code>top_padding</code>, <code>right_padding</code>, <code>bottom_padding</code> and <code>left_padding</code>.
 
=== top_padding ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== right_padding ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== bottom_padding ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== left_padding ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== margin ===
'''Type''': [[Types/int16|int16]]
 
Sets <code>top_margin</code>, <code>right_margin</code>, <code>bottom_margin</code> and <code>left_margin</code>.
 
=== top_margin ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== right_margin ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== bottom_margin ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== left_margin ===
'''Type''': [[Types/int16|int16]]
 
'''Default''': 0
 
=== effect ===
'''Type''': [[Types/string|string]]
 
Name of a custom GUI effect. Custom GUI effects are hardcoded in the game's C++ code. List of available effects: "compilatron-hologram"
 
=== effect_opacity ===
'''Type''': [[Types/float|float]]
 
'''Default''': 1.0
 
=== tooltip ===
'''Type''': [[Types/LocalisedString|LocalisedString]]
 
== Example ==
Example of adding a custom style via [[Prototype/GuiStyle]], in this case a [[Types/FrameStyleSpecification]]:
<syntaxhighlight lang="lua">data.raw["gui-style"]["default"]["custom_style_for_a_frame"] =
{
  type = "frame_style",
  parent = "frame",
  use_header_filler = false,
  drag_by_title = false
}</syntaxhighlight>

Latest revision as of 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/StyleSpecification.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.