Doc Changes

This commit is contained in:
Cooldude2606
2019-08-30 23:04:54 +01:00
parent a80d0bf99d
commit 361f9adc4e
96 changed files with 212 additions and 92 deletions

View File

@@ -13,6 +13,22 @@ local Gui = require 'expcore.gui.core'
@tparam ?string|Concepts.LocalisedString caption the message that is shown on the button
@tparam ?string|Concepts.LocalisedString tooltip the tooltip that shows when a player hovers over the button
@tparam SpritePath sprite upto three sprites in the order: default, hovered, clicked
@usage-- Making a basic button
local basic_button =
Gui.clone_concept('button','basic_button')
:set_caption('Basic Button')
:set_tooltip('Basic button')
:on_click(function(event)
event.player.print('You pressed basic button!')
end)
@usage-- Making a sprite button
local sprite_button =
Gui.clone_concept('button','sprite_button')
:set_sprite('utility/warning_icon')
:set_tooltip('Sprite button')
:on_click(function(event)
event.player.print('You pressed sprite button!')
end)
]]
Gui.new_concept('button')
:new_event('on_click',defines.events.on_gui_click)