Skip to content

styleutil

Source: base/tealdef/gui/main/styleutil.d.tl

Notes

Helper that builds an api.gui.StyleSheet from a plain Lua table.

StyleUtil

record global base/tealdef/gui/main/styleutil.d.tl:3

global record StyleUtil

Load: local styleutil = ug_require "::/gui/main/styleutil.tl" as StyleUtil

Notes

Style sheet helper.

Functions

makeStyle(styleTable : table) : StyleSheet base/tealdef/gui/main/styleutil.d.tl:4

Call as styleutil.makeStyle(…)

Notes

Creates an api.gui.StyleSheet from a table.

Parameter Type Description
styleTable table Table with any of borderColor, color, backgroundColor, backgroundColor1, backgroundColor2, borderWidth (each {r, g, b, a} or a Vec4f), size, anchorPoint ({x, y} or a Vec2f), backgroundImage1, backgroundImage2 (nine-patch) and fontSize (integer). Other keys are ignored.

Returns StyleSheet: The new style sheet.

Used in the base game: 48 times in 15 files

base/content/game_mechanics/game_mechanics/finance/finances_cargo_lifetime.tl:161

styleSheet = styleutil.makeStyle{
base/content/game_mechanics/game_mechanics/finance/finances_react_util.tl:55
styleSheet = styleutil.makeStyle{
base/content/gui/gui/entity_window/entity_window_util.tl:405
styleSheet = styleutil.makeStyle{
base/content/gui/gui/entity_window/industry_react_util.tl:436
styleSheet = styleutil.makeStyle{
base/content/gui/gui/entity_window/station_group/station_group.tl:281
styleSheet = styleutil.makeStyle{
base/content/gui/gui/entity_window/vehicle/vehicle.tl:103
styleSheet = styleutil.makeStyle{
… and 9 more files.