-
Notifications
You must be signed in to change notification settings - Fork 27
Using the theme system
Gustavo Lara edited this page Feb 23, 2018
·
16 revisions
GÖÖi uses a style object with some attributes, here's the default one (in component.lua):
component.style = {
bgColor = component.colors.blue,
fgColor = component.colors.white, -- Foreground color
tooltipFont = love.graphics.newFont(love.window.toPixels(11)), -- tooltips are smaller than the main font
radius = 2, -- raw pixels
innerRadius = 2, -- raw pixels
showBorder = true, -- border for components
borderColor = component.colors.blue,
borderWidth = love.window.toPixels(2), -- in pixels
borderStyle = "smooth", -- or "smooth"
font = love.graphics.newFont(love.window.toPixels(13)),
}
use:
gooi.setStyle(style)
to apply a style following the conventions above, all the attributes are optional.
Important notes:
- Set the style before creating any element
- For styling of an individual component see Generic component