mirror of
https://github.com/keharriso/love-nuklear.git
synced 2025-09-10 16:17:47 -04:00
Merge ea9aa4c463
into 5336818494
This commit is contained in:
commit
8527b45329
2 changed files with 25 additions and 2 deletions
|
@ -6,10 +6,14 @@ local checkboxTexture = love.graphics.newImage 'skin/checkbox.png'
|
||||||
local checkboxOff = {checkboxTexture, love.graphics.newQuad(0, 0, 51, 55, 58, 115)}
|
local checkboxOff = {checkboxTexture, love.graphics.newQuad(0, 0, 51, 55, 58, 115)}
|
||||||
local checkboxOn = {checkboxTexture, love.graphics.newQuad(0, 55, 58, 60, 58, 115)}
|
local checkboxOn = {checkboxTexture, love.graphics.newQuad(0, 55, 58, 60, 58, 115)}
|
||||||
local buttonTexture = love.graphics.newImage 'skin/button.png'
|
local buttonTexture = love.graphics.newImage 'skin/button.png'
|
||||||
local buttonNormal = {buttonTexture, love.graphics.newQuad(0, 0, 69, 52, 69, 156)}
|
|
||||||
local buttonActive = {buttonTexture, love.graphics.newQuad(0, 52, 69, 52, 69, 156)}
|
local buttonActive = {buttonTexture, love.graphics.newQuad(0, 52, 69, 52, 69, 156)}
|
||||||
local buttonHover = {buttonTexture, love.graphics.newQuad(0, 104, 69, 52, 69, 156)}
|
local buttonHover = {buttonTexture, love.graphics.newQuad(0, 104, 69, 52, 69, 156)}
|
||||||
|
|
||||||
|
|
||||||
|
-- last 4 args are 9-patch t/l/b/r. These are encoded as the number of pixels from the corresponding
|
||||||
|
-- edge (e.g. "4" for "r" means "4 pixels from the right edge", or w - 4).
|
||||||
|
local buttonNormal = {buttonTexture, love.graphics.newQuad(0, 0, 69, 52, 69, 156), 25, 12, 22, 12}
|
||||||
|
|
||||||
local style = {
|
local style = {
|
||||||
['text'] = {
|
['text'] = {
|
||||||
['color'] = '#000000'
|
['color'] = '#000000'
|
||||||
|
|
|
@ -3681,7 +3681,26 @@ static int nk_love_style_push_item(lua_State *L, struct nk_style_item *field)
|
||||||
}
|
}
|
||||||
item.type = NK_STYLE_ITEM_COLOR;
|
item.type = NK_STYLE_ITEM_COLOR;
|
||||||
item.data.color = nk_love_checkcolor(L, -1);
|
item.data.color = nk_love_checkcolor(L, -1);
|
||||||
} else {
|
} else if (lua_istable(L, -1) && lua_objlen(L, -1) == 6) {
|
||||||
|
item.type = NK_STYLE_ITEM_NINE_SLICE;
|
||||||
|
|
||||||
|
int index = lua_gettop(L);
|
||||||
|
nk_love_checkImage(L, -1, &item.data.slice.img);
|
||||||
|
|
||||||
|
lua_rawgeti(L, index, 3);
|
||||||
|
item.data.slice.l = lua_tointeger(L, -1);
|
||||||
|
|
||||||
|
lua_rawgeti(L, index, 4);
|
||||||
|
item.data.slice.t = lua_tointeger(L, -1);
|
||||||
|
|
||||||
|
lua_rawgeti(L, index, 5);
|
||||||
|
item.data.slice.r = lua_tointeger(L, -1);
|
||||||
|
|
||||||
|
lua_rawgeti(L, index, 6);
|
||||||
|
item.data.slice.b = lua_tointeger(L, -1);
|
||||||
|
lua_pop(L, 4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
item.type = NK_STYLE_ITEM_IMAGE;
|
item.type = NK_STYLE_ITEM_IMAGE;
|
||||||
nk_love_checkImage(L, -1, &item.data.image);
|
nk_love_checkImage(L, -1, &item.data.image);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue