mirror of
https://github.com/airstruck/luigi.git
synced 2025-11-18 12:25:06 +00:00
add mouse cursors
This commit is contained in:
@@ -67,6 +67,11 @@ function Input:handleMove (x, y)
|
||||
oldTarget = previousWidget,
|
||||
x = x, y = y
|
||||
})
|
||||
if widget.cursor then
|
||||
love.mouse.setCursor(love.mouse.getSystemCursor(widget.cursor))
|
||||
else
|
||||
love.mouse.setCursor()
|
||||
end
|
||||
self.previousMoveWidget = widget
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,6 +63,7 @@ return function (config)
|
||||
minimumWidth = 24,
|
||||
minimumHeight = 24,
|
||||
canFocus = true,
|
||||
cursor = 'ibeam',
|
||||
},
|
||||
text_focused = {
|
||||
slices = RESOURCE .. 'text_focused.png',
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
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)
|
||||
local axis = self.parent.flow
|
||||
if axis == 'x' then
|
||||
|
||||
Reference in New Issue
Block a user