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"

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/gui/gui/layers/layer_terrain.tl:115

styleSheet = styleutil.makeStyle{
base/content/gui/gui/line_vehicle_mgmt/vehicle_react_util.tl:82
styleSheet = styleutil.makeStyle{
base/content/gui/gui/line_vehicle_mgmt/line_manager_panel.tl:349
styleSheet = bubbleColor and styleutil.makeStyle{
base/content/gui/gui/line_vehicle_mgmt/manager_window.tl:3181
styleSheet = styleutil.makeStyle{
base/content/gui/gui/line_vehicle_mgmt/line_react_util.tl:296
styleSheet = styleutil.makeStyle{backgroundColor1 = api.type.Vec4f.new(color, 1.0)},
base/content/gui/gui/line_vehicle_mgmt/manager_hud_util.tl:37
styleSheet = styleutil.makeStyle{
… and 9 more files.