Updated Documentation (markdown)

Kevin Harrison 2016-11-14 21:25:37 -05:00
parent c706549796
commit 3192affec1

@ -344,7 +344,7 @@ End the current menu. Always call this at the end of any open menu.
#### nk.label(text) #### nk.label(text)
#### nk.label(text, align/'wrap') #### nk.label(text, align/'wrap')
#### nk.label(text, align/'wrap', color) #### nk.label(text, align/'wrap', [color](#colors))
Show a text string. Optionally specify an alignment and/or [color](#colors). Show a text string. Optionally specify an alignment and/or [color](#colors).
#### nk.image(img) #### nk.image(img)
@ -353,8 +353,8 @@ Show an image.
See [LÖVE Image](https://love2d.org/wiki/Image). See [LÖVE Image](https://love2d.org/wiki/Image).
#### activated = nk.button(title) #### activated = nk.button(title)
#### activated = nk.button(title, color/symbol/image) #### activated = nk.button(title, [color](#colors)/symbol/image)
Add a button with a title and/or a color, symbol, or image. Add a button with a title and/or a [color](#colors), symbol, or image.
Return `true` if activated, and `false` otherwise. Return `true` if activated, and `false` otherwise.
@ -403,13 +403,13 @@ Add a progress widget, optionally making it modifiable.
If given a number `current`, return the new `current` value. If given a table with a number field named `value` instead, the field gets updated and the function returns `true` on a change and `false` otherwise. If given a number `current`, return the new `current` value. If given a table with a number field named `value` instead, the field gets updated and the function returns `true` on a change and `false` otherwise.
#### color = nk.color_picker(color) #### [color](#colors) = nk.color_picker([color](#colors))
#### color = nk.color_picker(color, 'RGB'/'RGBA') #### [color](#colors) = nk.color_picker([color](#colors), 'RGB'/'RGBA')
#### changed = nk.color_picker(value_table) #### changed = nk.color_picker(value_table)
#### changed = nk.color_picker(value_table, 'RGB'/'RGBA') #### changed = nk.color_picker(value_table, 'RGB'/'RGBA')
Add a color picker widget, optionally specifying format (default 'RGB', no alpha). Add a color picker widget, optionally specifying format (default 'RGB', no alpha).
If given a `color` string, return the new `color`. If given a table with a color string field named `value` instead, the field gets updated and the function returns `true` on change and `false` otherwise. If given a `[color](#colors)` string, return the new `[color](#colors)`. If given a table with a [color](#colors) string field named `value` instead, the field gets updated and the function returns `true` on change and `false` otherwise.
#### current = nk.property(name, min, current, max, step, inc_per_pixel) #### current = nk.property(name, min, current, max, step, inc_per_pixel)
#### changed = nk.property(name, min, value_table, max, step, inc_per_pixel) #### changed = nk.property(name, min, value_table, max, step, inc_per_pixel)
@ -433,10 +433,10 @@ Add a drop-down combobox widget. `items` should be an array of strings. `item_he
If a number `index` is specified, then the function returns the new selected `index`. If a table with a number field `value` is given instead, then the field gets updated with the currently selected index and the function returns `true` on change and `false` otherwise. If a number `index` is specified, then the function returns the new selected `index`. If a table with a number field `value` is given instead, then the field gets updated with the currently selected index and the function returns `true` on change and `false` otherwise.
#### open = nk.combobox_begin(text) #### open = nk.combobox_begin(text)
#### open = nk.combobox_begin(text, color/symbol/image) #### open = nk.combobox_begin(text, [color](#colors)/symbol/image)
#### open = nk.combobox_begin(text, color/symbol/image, width) #### open = nk.combobox_begin(text, [color](#colors)/symbol/image, width)
#### open = nk.combobox_begin(text, color/symbol/image, width, height) #### open = nk.combobox_begin(text, [color](#colors)/symbol/image, width, height)
Start a combobox widget. This form gives complete control over the drop-down list (it's treated like a new window). Color/symbol/image defaults to none, while width and height default to sensible values based on widget bounds. Start a combobox widget. This form gives complete control over the drop-down list (it's treated like a new window). [Color](#colors)/symbol/image defaults to none, while width and height default to sensible values based on widget bounds.
Remember to call `nk.combobox_end` if the combobox is open. Remember to call `nk.combobox_end` if the combobox is open.
@ -577,11 +577,11 @@ 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 the following style items:
```
local style = { local style = {
['font'] = <Font>, ['font'] = <Font>,
['text'] = { ['text'] = {
['color'] = <color>, ['color'] = color,
}, },
['button'] = { ['button'] = {
@ -633,4 +633,3 @@ local style = {
} }
} }
```