From 2db2716e1065ac8423277e0b2eb7e8e65c7cf625 Mon Sep 17 00:00:00 2001 From: Kevin Harrison Date: Mon, 14 Nov 2016 21:37:03 -0500 Subject: [PATCH] Updated Documentation (markdown) --- Documentation.md | 59 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/Documentation.md b/Documentation.md index 9c2ff7c..e4fa2e0 100644 --- a/Documentation.md +++ b/Documentation.md @@ -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'] = , +#### 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'] = { } -} \ No newline at end of file +} +``` \ No newline at end of file