mirror of
https://github.com/keharriso/love-nuklear.git
synced 2025-09-10 16:17:47 -04:00
Scissor example
Scissor button example
This commit is contained in:
parent
bf89bf9f08
commit
05dfdb5c34
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,7 @@ local colorPicker = {value = '#ff0000'}
|
||||||
local property = {value = 6}
|
local property = {value = 6}
|
||||||
local edit = {value = 'Edit text'}
|
local edit = {value = 'Edit text'}
|
||||||
local comboA = {value = 1, items = {'A', 'B', 'C'}}
|
local comboA = {value = 1, items = {'A', 'B', 'C'}}
|
||||||
|
local scissorActive = false
|
||||||
|
|
||||||
return function (ui)
|
return function (ui)
|
||||||
if ui:windowBegin('Overview', 100, 100, 600, 450, 'border', 'movable', 'title') then
|
if ui:windowBegin('Overview', 100, 100, 600, 450, 'border', 'movable', 'title') then
|
||||||
|
@ -49,6 +50,9 @@ return function (ui)
|
||||||
ui:spacing(1)
|
ui:spacing(1)
|
||||||
ui:checkbox('Checkbox A', checkA)
|
ui:checkbox('Checkbox A', checkA)
|
||||||
ui:checkbox('Checkbox B', checkB)
|
ui:checkbox('Checkbox B', checkB)
|
||||||
|
if ui:button('Scissor') then
|
||||||
|
scissorActive = not scissorActive
|
||||||
|
end
|
||||||
ui:groupEnd()
|
ui:groupEnd()
|
||||||
end
|
end
|
||||||
if ui:groupBegin('Group 2', 'border') then
|
if ui:groupBegin('Group 2', 'border') then
|
||||||
|
@ -104,4 +108,11 @@ return function (ui)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ui:windowEnd()
|
ui:windowEnd()
|
||||||
|
if(scissorActive) then
|
||||||
|
love.graphics.setScissor()
|
||||||
|
love.graphics.clear()
|
||||||
|
love.graphics.setScissor(130, 130, 500, 400)
|
||||||
|
else
|
||||||
|
love.graphics.setScissor()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue