Skip to content
Snippets Groups Projects
Commit cc1fbcc8 authored by dg's avatar dg
Browse files

move drag resize yay baby

git-svn-id: http://svn.net-core.org/repos/t-engine4@4775 51575b47-30f0-44d4-a5cc-537603b46e54
parent c810b165
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ function _M:receiveMouse(button, x, y, isup, force_name, extra)
if not isup then return end
if _M.drag then
if _M.drag.prestart then _M.drag = nil print("====?????")
if _M.drag.prestart then _M.drag = nil
else return self:endDrag(x, y) end
end
......@@ -145,22 +145,27 @@ function _M:reset()
self.areas = {}
end
function _M:startDrag(x, y, cursor, payload, on_done, on_move)
function _M:startDrag(x, y, cursor, payload, on_done, on_move, no_prestart)
local start = function()
_M.drag.prestart = nil
if _M.drag.cursor then
local w, h = _M.drag.cursor:getSize()
_M.drag.cursor = _M.drag.cursor:glTexture()
core.display.setMouseDrag(_M.drag.cursor, w, h)
end
print("[MOUSE] enabling drag from predrag")
end
if _M.drag then
if _M.drag.prestart and math.max(math.abs(_M.drag.start_x - x), math.abs(_M.drag.start_y - y)) > 6 then
_M.drag.prestart = nil
if _M.drag.cursor then
local w, h = _M.drag.cursor:getSize()
_M.drag.cursor = _M.drag.cursor:glTexture()
core.display.setMouseDrag(_M.drag.cursor, w, h)
end
print("[MOUSE] enabling drag from predrag")
start()
end
return
end
_M.drag = {start_x=x, start_y=y, payload=payload, on_done=on_done, on_move=on_move, prestart=true, cursor=cursor}
print("[MOUSE] pre starting drag'n'drop")
if no_prestart then start() end
end
function _M:endDrag(x, y)
......
This diff is collapsed.
game/modules/tome/data/gfx/ui/hotkeys/separator.png

9.48 KiB | W: | H:

game/modules/tome/data/gfx/ui/hotkeys/separator.png

7.12 KiB | W: | H:

game/modules/tome/data/gfx/ui/hotkeys/separator.png
game/modules/tome/data/gfx/ui/hotkeys/separator.png
game/modules/tome/data/gfx/ui/hotkeys/separator.png
game/modules/tome/data/gfx/ui/hotkeys/separator.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment