mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-10 16:28:23 +00:00
add mouse cursors
This commit is contained in:
@@ -67,6 +67,11 @@ function Input:handleMove (x, y)
|
|||||||
oldTarget = previousWidget,
|
oldTarget = previousWidget,
|
||||||
x = x, y = y
|
x = x, y = y
|
||||||
})
|
})
|
||||||
|
if widget.cursor then
|
||||||
|
love.mouse.setCursor(love.mouse.getSystemCursor(widget.cursor))
|
||||||
|
else
|
||||||
|
love.mouse.setCursor()
|
||||||
|
end
|
||||||
self.previousMoveWidget = widget
|
self.previousMoveWidget = widget
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ return function (config)
|
|||||||
minimumWidth = 24,
|
minimumWidth = 24,
|
||||||
minimumHeight = 24,
|
minimumHeight = 24,
|
||||||
canFocus = true,
|
canFocus = true,
|
||||||
|
cursor = 'ibeam',
|
||||||
},
|
},
|
||||||
text_focused = {
|
text_focused = {
|
||||||
slices = RESOURCE .. 'text_focused.png',
|
slices = RESOURCE .. 'text_focused.png',
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
return function (self)
|
return function (self)
|
||||||
|
|
||||||
|
self:onEnter(function (event)
|
||||||
|
local axis = self.parent.flow
|
||||||
|
if axis == 'x' then
|
||||||
|
self.cursor = 'sizewe'
|
||||||
|
else
|
||||||
|
self.cursor = 'sizens'
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
self:onPressDrag(function (event)
|
self:onPressDrag(function (event)
|
||||||
local axis = self.parent.flow
|
local axis = self.parent.flow
|
||||||
if axis == 'x' then
|
if axis == 'x' then
|
||||||
|
|||||||
Reference in New Issue
Block a user