Core Module - ExpStyle
expcore.gui |
gui.concept.frame |
gui.concept.flow |
gui.concept.table |
gui.concept.scroll |
expcore.common |
alignment | A flow which can be used to align text and other 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 |
data_label:update_data_element(element, data) | Updates the caption and tooltip of the data label using the data format function |
data_label:update_from_parent(parent, data) | Updates the caption and tooltip of the data label using the data format function, given the parent of the data label |
time_label:update_time(element, time) | Updates the time that is on a label |
unit_label:update_data_element(element, data) | Updates the caption and tooltip and unit of the data label using the data format function |
unit_label:update_from_parent(parent, data) | Updates the caption and tooltip and unit of the unit label using the data format function, given the parent of the unit label |
A flow which can be used to align text and other elements
See also: Usage:-- Concept Structure
-- Root
--> [alignment] - the alignment area
Gui.new_concept('alignment')
:set_horizontal_align('center')
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')
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)
A frame that acts as a footer to a section of content
Properties / Events:-- 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')
A frame that acts as a header to a section of content
Properties / Events:-- 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')
A table that is inside a vertical scroll area
Properties / Events:-- Concept Structure
-- Root
--> [scroll_table] - the scroll area
-->> table - the table area
Gui.new_concept('scroll_table')
:set_height(200)
:set_column_count(2)
A label that show time in a nice, user friendly way
Properties / Events:-- 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)
A button that will toggle its caption each time it is pressed
Properties / Events:-- 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)
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)
Updates the caption and tooltip of the data label using the data format function
Parameters:-- Updating the data to the current game tick
data_label:update_data_element(element,game.tick)
Updates the caption and tooltip of the data label using the data format function, given the parent of the data label
Parameters:-- Updating the data to the current game tick
data_label:update_from_parent(parent,game.tick)
Updates the time that is on a label
Parameters:-- Update the time to show game time
time_label:update_time(element,game.time)
Updates the caption and tooltip and unit of the data label using the data format function
Parameters:-- Updating the data to the current game tick
unit_label:update_data_element(element,game.tick)
Updates the caption and tooltip and unit of the unit label using the data format function, given the parent of the unit label
Parameters:-- Updating the data to the current game tick
unit_label:update_from_parent(parent,game.tick)