18 lines
632 B
Plaintext
18 lines
632 B
Plaintext
snapshot_canvas = function()
|
|
-- Render the canvas at pixel perfect resolution.
|
|
local winw,winh = App.screen.width, App.screen.height
|
|
App.screen.width,App.screen.height = Global_viewport.w, Global_viewport.h
|
|
local saved_viewport = Viewport
|
|
Viewport = copy_viewport(Global_viewport)
|
|
Viewport.zoom = 1.0
|
|
A()
|
|
Canvas = love.graphics.newCanvas(Global_viewport.w, Global_viewport.h)
|
|
love.graphics.setCanvas(Canvas)
|
|
App.fake_key_press = true -- Hack; disable drawing the menu and ticks
|
|
on.draw()
|
|
App.fake_key_press = nil
|
|
love.graphics.setCanvas()
|
|
Viewport = saved_viewport
|
|
App.screen.width,App.screen.height = winw,winh
|
|
end
|