mirror of
https://github.com/keharriso/love-nuklear.git
synced 2025-09-11 00:27:48 -04:00
Updated Documentation (markdown)
parent
3192affec1
commit
2db2716e10
1 changed files with 52 additions and 7 deletions
|
@ -576,16 +576,60 @@ local color_table = {
|
|||
|
||||
### 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 = {
|
||||
['font'] = <Font>,
|
||||
#### nk.style_set_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'] = {
|
||||
['color'] = color,
|
||||
|
||||
['color'] = '#000000'
|
||||
},
|
||||
['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'] = {
|
||||
|
||||
|
@ -632,4 +676,5 @@ local style = {
|
|||
['window'] = {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue