2Q437U4FVEYO3Y22OC3NC5MAYVEDTTCWCRJHBKHKWA4WZSPWYUDQC slide_canvas = function(pane_index, dir)return function()end_frame()if dir == 'right' thenfor i=1,40 doprint(Current_time, i)love.graphics.rectangle('fill', i*10,0, 30, App.screen.height)end_frame()endelseif dir == 'left' thenfor i=20,1,-1 doprint(i)love.graphics.line(i*50,0, i*50, App.screen.height)end_frame()endendendend
-- update any in-progress animations-- return whether any work remainsdraw_next_frames_of_animations = function()local a = Animations_in_progressfor i=#a,1,-1 doif coroutine.status(a[i].co) == 'dead' thentable.remove(a, i)elselocal status, err = coroutine.resume(a[i].co)if status == false then error(err) endendendreturn #a > 0end
-- 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 = nillocal co = coroutine.create(function()xpcall(function()f(unpack(args))end,save_callstack)end)coroutine.resume(co, ...)if Error_with_callstack thenerror(Error_with_callstack)endtable.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().