ExpStyle module

Core Module - ExpStyle

Dependencies

expcore.gui
gui.concept.frame
expcore.gui
gui.concept.frame
expcore.gui
gui.concept.table
expcore.gui
gui.concept.table
expcore.gui
gui.concept.table
gui.concept.scroll
expcore.gui
expcore.common
expcore.gui
gui.concept.table
expcore.gui
gui.concept.frame

Elements

container A container frame that can be used to add a boader around your content
data_label A label pair which has a static label and a data label which can be changed
footer A frame that acts as a footer to a section of content
header A frame that acts as a header to a section of content
scroll_table A table that is inside a vertical scroll area
time_label A label that show time in a nice, user friendly way
toggle_button A button that will toggle its caption each time it is pressed
unit_label A label triplet which has a static label, a data label which can be changed, and a unit label

Functions

time_label:update_time(element, time) Updates the time that is on a label

Dependencies

# expcore.gui
# gui.concept.frame
# expcore.gui
# gui.concept.frame
# expcore.gui
# gui.concept.table
# expcore.gui
# gui.concept.table
# expcore.gui
# gui.concept.table
# gui.concept.scroll
# expcore.gui
# expcore.common
# expcore.gui
# gui.concept.table
# expcore.gui
# gui.concept.frame

Elements

# container

A container frame that can be used to add a boader around your content

See also: Usage:
-- Concept Structure
-- Root
--> [container] - the outer frame
-->> container - the content area
Gui.new_concept('container')
# data_label

A label pair which has a static label and a data label which can be changed

See also: Usage:
-- Concept Structure
-- Root
--> [data_label] - the static label
--> [properties.data_name] - the data label which can be updated
Gui.new_concept('data_label')
:set_data_label_name('game_ticks')
:set_data_caption('0')
:set_data_format(function(concept,element,data,...)
    -- This is used with update_data_element and update_from_parent
    local caption = tostirng('data')
    local tooltip = 'This game has beeing running for: '..caption..' ticks'
    return caption, tooltip
end)
# footer

A frame that acts as a footer to a section of content

Properties / Events:
  • tooltip : (string) the tooltip to show on the title
See also: Usage:
-- Concept Structure
-- Root
--> [footer] - the footer frame
-->> footer_caption - the lable with the title in it
-->> footer_content - the area to contain butons
Gui.new_concept('footer')
:set_title('Example Footer')
# header

A frame that acts as a header to a section of content

Properties / Events:
  • tooltip : (string) the tooltip to show on the title
See also: Usage:
-- Concept Structure
-- Root
--> [header] - the header frame
-->> header_caption - the lable with the title in it
-->> header_content - the area to contain butons
Gui.new_concept('header')
:set_title('Example Header')
# scroll_table

A table that is inside a vertical scroll area

Properties / Events:
  • hight : (number) the max hight of the scroll area
See also: Usage:
-- Concept Structure
-- Root
--> [scroll_table] - the scroll area
-->> table - the table area
Gui.new_concept('scroll_table')
:set_height(200)
:set_column_count(2)
# time_label

A label that show time in a nice, user friendly way

Properties / Events:
  • time : (number) the time to display in tick
Usage:
-- Concept Structure
-- Root
--> [time_label] - the label with the time
local time_label =
Gui.new_concept('time_label')
:set_use_hours(true)
:set_time(game.tick)

time_label:update_time(element,game.tick)
# toggle_button

A button that will toggle its caption each time it is pressed

Properties / Events:
  • alt_caption : (string) the caption to show on the button in its true state
  • alt_tooltip : (string) the tooltip to show on the button in its true state
See also: Usage:
-- Concept Structure
-- Root
--> [toggle_button] - the header button
Gui.new_concept('toggle_button')
:set_caption('<')
:set_tooltip('Press to close.')
:set_alt_caption('>')
:set_alt_tooltip('Press to open.')
:on_click(function(event)
    local state = event.state and 'close' or 'open'
    event.player.print('Toggle button is now: '..state)
end)
# unit_label

A label triplet which has a static label, a data label which can be changed, and a unit label

See also: Usage:
-- Concept Structure
-- Root
--> [unit_label] - the static label
--> [properties.data_name] - the data label which can be updated
--> [properties.data_name..'_unit'] - the data label unit which can be updated
Gui.new_concept('unit_label')
:set_data_label_name('game_ticks')
:set_data_caption('0')
:set_data_unit('ticks')
:set_data_format(function(concept,element,data,...)
    -- This is used with update_data_element and update_from_parent
    local caption = tostirng(data)
    local unit = data > 1 and 'ticks' or 'tick'
    local tooltip = 'This game has beeing running for: '..caption..' ticks'
    return caption, unit, tooltip
end)

Functions

# time_label:update_time(element, time)

Updates the time that is on a label

Parameters:
  • element : (LuaGuiElement) the label that you want to update
  • time : (number) the number of tick you want it to show
Usage:
-- Update the time to show game time
time_label:update_time(element,game.time)