implement 'Run' button

akkartik
Nov 19, 2023, 3:43 AM
WR2WMEPEKNFAB4CAUBVFBACAJJSX2VX5B2VHKKSNTJSJBIIXFVZQC

Dependencies

  • [2] PRE6XPRN responsively increase/decrease font height
  • [*] R5QXEHUI somebody stop me
  • [*] 5RUFNRJO start of the visual skeleton
  • [*] ZM7NOBRM new fork: carousel shell

Change contents

  • file addition: 0043-map (----------)
    [4.2]
    map = function(arr, f)
    local result = {}
    for _, x in ipairs(arr) do
    table.insert(result, f(x))
    end
    return result
    end
  • file addition: 0042-draw_canvas (----------)
    [4.2]
    draw_canvas = function()
    if Canvas == nil then return end
    love.graphics.setBlendMode('alpha', 'premultiplied')
    love.graphics.setColor(1,1,1,1)
    love.graphics.draw(Canvas, 0,0)
    love.graphics.setBlendMode('alpha')
    end
  • file addition: 0041-Canvas (----------)
    [4.2]
    Canvas = nil
  • edit in 0021-draw_menu at line 13
    [5.1085]
    [2.946]
    local buf = table.concat(map(Editor_state.lines, function(line) return line.data end), '\n')
    Canvas = love.graphics.newCanvas()
    love.graphics.setCanvas(Canvas)
    love.graphics.push('all')
    love.graphics.setBackgroundColor(1,1,1)
    love.graphics.setColor(0,0,0)
    local status, result = live.eval(buf)
    if not status then
    print(result)
    end
    love.graphics.pop()
    love.graphics.setCanvas()
  • edit in 0012-on.draw at line 3
    [5.1793]
    [5.1793]
    draw_canvas()
    --if Canvas then return end