mirror of
https://github.com/keharriso/love-nuklear.git
synced 2025-09-10 16:17:47 -04:00
Update draw example: use colors in [0,1] instead of [0,255]
This commit is contained in:
parent
2fd70e6062
commit
0d14e1c2cf
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ local img = love.graphics.newImage 'skin/button.png'
|
||||||
return function (ui)
|
return function (ui)
|
||||||
if ui:windowBegin('Draw Example', 300, 300, 200, 200, 'title', 'movable', 'border') then
|
if ui:windowBegin('Draw Example', 300, 300, 200, 200, 'title', 'movable', 'border') then
|
||||||
local x, y, w, h = ui:windowGetBounds()
|
local x, y, w, h = ui:windowGetBounds()
|
||||||
love.graphics.setColor(255, 0, 0)
|
love.graphics.setColor(1, 0, 0)
|
||||||
ui:line(x + 10, y + 40, x + 50, y + 40, x + 50, y + 80)
|
ui:line(x + 10, y + 40, x + 50, y + 40, x + 50, y + 80)
|
||||||
ui:curve(x + 50, y + 80, x + 80, y + 40, x + 100, y + 80, x + 80, y + 80)
|
ui:curve(x + 50, y + 80, x + 80, y + 40, x + 100, y + 80, x + 80, y + 80)
|
||||||
ui:polygon('line', x + 100, y + 150, x + 60, y + 140, x + 70, y + 70)
|
ui:polygon('line', x + 100, y + 150, x + 60, y + 140, x + 70, y + 70)
|
||||||
|
@ -13,7 +13,7 @@ return function (ui)
|
||||||
ui:ellipse('fill', x + 30, y + 150, 20, 40)
|
ui:ellipse('fill', x + 30, y + 150, 20, 40)
|
||||||
ui:arc('fill', x + 150, y + 80, 40, 3 * math.pi / 2, 2 * math.pi);
|
ui:arc('fill', x + 150, y + 80, 40, 3 * math.pi / 2, 2 * math.pi);
|
||||||
ui:rectMultiColor(x + 95, y + 50, 50, 50, '#ff0000', '#00ff00', '#0000ff', '#000000')
|
ui:rectMultiColor(x + 95, y + 50, 50, 50, '#ff0000', '#00ff00', '#0000ff', '#000000')
|
||||||
love.graphics.setColor(255, 255, 255)
|
love.graphics.setColor(1, 1, 1)
|
||||||
ui:image(img, x + 120, y + 120, 70, 50)
|
ui:image(img, x + 120, y + 120, 70, 50)
|
||||||
ui:text('DRAW TEXT', x + 15, y + 75, 100, 100)
|
ui:text('DRAW TEXT', x + 15, y + 75, 100, 100)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue