add mouse cursors

This commit is contained in:
airstruck
2015-10-31 15:48:51 -04:00
parent 6c82e5f81d
commit c069c8d310
3 changed files with 15 additions and 0 deletions

View File

@@ -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

View File

@@ -63,6 +63,7 @@ return function (config)
minimumWidth = 24,
minimumHeight = 24,
canFocus = true,
cursor = 'ibeam',
},
text_focused = {
slices = RESOURCE .. 'text_focused.png',

View File

@@ -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