Add cornerRadius option to override theme corner radius
This commit is contained in:
parent
5298f31d06
commit
01f7cd88fb
2 changed files with 6 additions and 1 deletions
|
@ -166,6 +166,9 @@ Common Options
|
||||||
``color``
|
``color``
|
||||||
A table to overwrite the color. Undefined colors default to the theme colors.
|
A table to overwrite the color. Undefined colors default to the theme colors.
|
||||||
|
|
||||||
|
``cornerRadius``
|
||||||
|
The corner radius for boxes. Overwrites the theme corner radius.
|
||||||
|
|
||||||
``draw``
|
``draw``
|
||||||
A function to replace the drawing function. Refer to :doc:`themes` for more information about the function signatures.
|
A function to replace the drawing function. Refer to :doc:`themes` for more information about the function signatures.
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,10 @@ end
|
||||||
|
|
||||||
function theme.drawBox(x,y,w,h, opt, colors)
|
function theme.drawBox(x,y,w,h, opt, colors)
|
||||||
local colors = colors or theme.getColorForState(opt)
|
local colors = colors or theme.getColorForState(opt)
|
||||||
|
local cornerRadius = opt.cornerRadius or theme.cornerRadius
|
||||||
|
|
||||||
love.graphics.setColor(colors.bg)
|
love.graphics.setColor(colors.bg)
|
||||||
love.graphics.rectangle('fill', x,y, w,h, theme.cornerRadius)
|
love.graphics.rectangle('fill', x,y, w,h, cornerRadius)
|
||||||
end
|
end
|
||||||
|
|
||||||
function theme.getVerticalOffsetForAlign(valign, font, h)
|
function theme.getVerticalOffsetForAlign(valign, font, h)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue