-
Notifications
You must be signed in to change notification settings - Fork 26
Home
Pawel edited this page Jun 19, 2018
·
7 revisions
StdUi stands for StandardUi. Which means this library is a provides a factory for default blizzard UI objects such as Button
, FontString
, EditBox
.
Library aims to be alternative to AceGUI that does not have a fixed layout nor forces you to do layout functions. In addition, it produces widgets similar to the looks of ElvUI.
Bootstrap LibStub
and StdUi
in your addon TOC file:
Libs\LibStub\LibStub.lua
Libs\StdUi\StdUi.xml
Then you can use StdUi in your lua
files:
local StdUi = LibStub('StdUi');
You might want to use different color/fonts configuration but to do so, create new instance instead of using global functions:
local StdUi = LibStub('StdUi'):NewInstance();
StdUi.config = {
-- your config
};
Full config object should look like this:
{
font = {
familly = 'Fonts\\ARIALN.ttf', -- Font used across your addon
size = 12, -- Font size
effect = 'OUTLINE', -- Font effects
strata = 'OVERLAY', -- Font strata
color = { r = 1, g = 1, b = 1, a = 1 }, -- Font text color
colorDisabled = { r = 0.55, g = 0.55, b = 0.55, a = 1 }, -- Font color when widget is disabled
},
backdrop = {
texture = [[Interface\Buttons\WHITE8X8]], -- Backdrop texture
panel = { r = 0.10, g = 0.10, b = 0.10, a = 1 }, -- Color of panels
slider = { r = 0.15, g = 0.15, b = 0.15, a = 1 }, -- Color of sliders
button = { r = 0.25, g = 0.25, b = 0.25, a = 1 }, -- Button color
buttonDisabled = { r = 0.15, g = 0.15, b = 0.15, a = 1 }, -- Button color when disabled
border = { r = 0.80, g = 0.80, b = 0.80, a = 1 }, -- Border color
borderDisabled = { r = 0.40, g = 0.40, b = 0.40, a = 1 } -- Border color when disabled
},
highlight = {
color = { r = 1, g = 0.9, b = 0, a = 0.4 }, -- Highlight color
blank = { r = 0, g = 0, b = 0, a = 0 } -- Highlight 'off' color
},
dialog = { -- Dialog settings
width = 400, -- Dialogs default width
height = 100, -- Dialogs default height
button = {
width = 100, -- Dialog button width
height = 20, -- Dialog button height
margin = 5 -- Dialog margin between buttons
}
},
tooltip = {
padding = 10 -- Frame tooltip padding
}
};