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= from_viewport(state)-- once we've checked keys, pollute the keyspacestate.step = 0state.frame_time = 0returnendstate.frame_time = state.frame_time + dtif state.frame_time > 0.01 thenstate.frame_time = state.frame_time - 0.01state.step = state.step+1interpolate_viewport(state.initial, state, state.step)B()endendprint('animation frame: Viewport is now', Viewport.x, Viewport.y, Viewport.zoom)
animate_next = function(dt)if Animating[1].step and Animating[1].step >= Num_animation_frames thentable.remove(Animating, 1)if #Animating == 0 thenAnimating = nilCanvas = nilA()returnendendanimate_next_frame(Animating[1], dt)endGlobal_viewport = nilprint('Viewport at end of survey animation', Viewport.x, Viewport.y, Viewport.zoom)
Animating = nil -- set this to enable animation-- When enabled, animation should consist of a series of viewport states that we animate into.-- Each viewport state will be attained in Num_animation_frames frames, each of 0.01 ms or 1 Love frame.-- Each state will specify the final state of various viewport keys. Keys not mentioned will remain unchanged.
animate_to = function(dest)local state = {x=dest.x, y=dest.y, zoom=dest.zoom,initial=from_viewport(dest),step = 0,frame_time = 0,}while true dolove.event.pump()for name, a,b,c,d,e,f in love.event.poll() doif name == "quit" thenos.exit(0)end-- ignore other eventsend-- updatedt = love.timer.step()state.frame_time = state.frame_time + dtif state.frame_time > 0.01 thenstate.frame_time = state.frame_time - 0.01state.step = state.step + 1if state.step >= Num_animation_frames thenreturnendinterpolate_viewport(state.initial, state, state.step)print('animation frame: Viewport is now', Viewport.x, Viewport.y, Viewport.zoom)B()end-- drawlove.graphics.origin()love.graphics.clear(love.graphics.getBackgroundColor())local q = love.graphics.newQuad((Viewport.x-Global_viewport.x)*Viewport.zoom,(Viewport.y-Global_viewport.y)*Viewport.zoom,App.screen.width,App.screen.height,Global_bounds.w*Viewport.zoom,Global_bounds.h*Viewport.zoom)App.color{r=1,g=1,b=1}love.graphics.draw(Canvas, q, 0,0)love.graphics.present()love.timer.sleep(0.001)endend
Animating = {Save_viewport,}Save_viewport = nil
animate_to(Save_viewport)print('Viewport at end of undo zoom out animation', Viewport.x, Viewport.y, Viewport.zoom)Canvas = nilGlobal_viewport = nilA()
Animating = {{x=sx(x)-App.screen.width/Save_viewport.zoom/2,y=sy(y)-App.screen.height/Save_viewport.zoom/2,w=App.screen.width/Save_viewport.zoom,h=App.screen.height/Save_viewport.zoom,zoom=Save_viewport.zoom,},
animate_to{x=sx(x)-App.screen.width/Save_viewport.zoom/2,y=sy(y)-App.screen.height/Save_viewport.zoom/2,zoom=Save_viewport.zoom,
if Animating thenlocal q = love.graphics.newQuad((Viewport.x-Global_viewport.x)*Viewport.zoom,(Viewport.y-Global_viewport.y)*Viewport.zoom,App.screen.width,App.screen.height,Global_bounds.w*Viewport.zoom,Global_bounds.h*Viewport.zoom)App.color{r=1,g=1,b=1}love.graphics.draw(Canvas, q, 0,0)returnend