Updated Documentation (markdown)

Kevin Harrison 2016-11-14 21:37:03 -05:00
parent 3192affec1
commit 2db2716e10

@ -576,16 +576,60 @@ local color_table = {
### Styles ### Styles
For finer-grained control over styles, including custom image-based skinning, Nuklear provides the following style items: For finer-grained control over styles, including custom image-based skinning, Nuklear provides a wide arrangement of style items.
local style = { #### nk.style_set_font(font)
['font'] = <Font>, Set the current font.
See [LÖVE Font](https://love2d.org/wiki/Font).
#### nk.style_push(style)
Push any number of [style items](#style-items) onto the style stack.
Example (see [skin.lua](https://github.com/keharriso/love-nuklear/blob/master/example/skin.lua)):
```
nk.style_push {
['text'] = { ['text'] = {
['color'] = color, ['color'] = '#000000'
}, },
['button'] = { ['button'] = {
['normal'] = love.graphics.newImage 'skin/button.png',
['hover'] = love.graphics.newImage 'skin/button_hover.png',
['active'] = love.graphics.newImage 'skin/button_active.png',
['text background'] = '#00000000',
['text normal'] = '#000000',
['text hover'] = '#000000',
['text active'] = '#ffffff'
}
}
```
#### nk.style_pop()
Pop the most recently pushed style.
### Style Items
```
local style = {
['font'] = Font,
['text'] = {
['color'] = color,
['padding'] = {x = number, y = number}
},
['button'] = {
['normal'] = color or Image,
['hover'] = color or Image,
['active'] = color or Image,
['border color'] = color,
['text background'] = color,
['text normal'] = color,
['text hover'] = color,
['text active'] = color,
['text alignment'] = color,
['border'] = number,
['rounding'] = number,
['padding'] = {x = number, y = number},
['image padding'] = {x = number, y = number},
['touch padding'] = {x = number, y = number}
}, },
['contextual button'] = { ['contextual button'] = {
@ -632,4 +676,5 @@ local style = {
['window'] = { ['window'] = {
} }
} }
```