2Q437U4FVEYO3Y22OC3NC5MAYVEDTTCWCRJHBKHKWA4WZSPWYUDQC
slide_canvas = function(pane_index, dir)
return function()
end_frame()
if dir == 'right' then
for i=1,40 do
print(Current_time, i)
love.graphics.rectangle('fill', i*10,0, 30, App.screen.height)
end_frame()
end
elseif dir == 'left' then
for i=20,1,-1 do
print(i)
love.graphics.line(i*50,0, i*50, App.screen.height)
end_frame()
end
end
end
end
-- update any in-progress animations
-- return whether any work remains
draw_next_frames_of_animations = function()
local a = Animations_in_progress
for i=#a,1,-1 do
if coroutine.status(a[i].co) == 'dead' then
table.remove(a, i)
else
local status, err = coroutine.resume(a[i].co)
if status == false then error(err) end
end
end
return #a > 0
end
-- Pause a drawing called by animate().
end_frame = function()
coroutine.yield()
end
-- Intermediate state during animations.
Animations_in_progress = {}
-- A debugging aid to help animate intermediate results within f.
-- Pause animation in the current frame using loiter().
-- Try to only have one such call in your program.
-- You can have multiple, but things might get confusing if one of them indirectly calls the other,
-- or more generally if a single function ever loiters sometimes under the call tree of one and sometimes under the other.
enable_loiter = function(f, ...)
local args = {...}
Error_with_callstack = nil
local co = coroutine.create(
function()
xpcall(function()
f(unpack(args))
end,
save_callstack)
end)
coroutine.resume(co, ...)
if Error_with_callstack then
error(Error_with_callstack)
end
table.insert(Debug_animations_in_progress, {co=co, next_run=Current_time+0.3})
end
-- A debugging aid to help animate intermediate results within f.
-- Pause animation in the current frame using loiter().
-- Try to only have one such call in your program.
-- You can have multiple, but things might get confusing if one of them indirectly calls the other,
-- or more generally if a single function ever loiters sometimes under the call tree of one and sometimes under the other.
-- Animate 'f' by smearing its work across multiple frames.
-- Pause animation in the current frame using end_frame().