subject people to a tutorial

akkartik
Nov 21, 2023, 7:05 AM
OOSUBWKXQ3UAQOXDKBVBXHBZPTU2OVGFXZHBEXDEICFDHRGQIALQC

Dependencies

  • [2] VUF2SX7B implement carousel buttons for inserting/switching current pane
  • [*] R5QXEHUI somebody stop me
  • [*] ZM7NOBRM new fork: carousel shell
  • [*] 5RUFNRJO start of the visual skeleton

Change contents

  • file addition: 0078-Example_panes (----------)
    [4.2]
    -- some examples
    -- each element of this array is itself an array of lines that will get loaded into a pane
    Example_panes = {
    {
    "-- some examples; feel free to delete them and they'll never return",
    '-- first example: you can perform simple calculations.',
    '-- (scroll down..)',
    "-- Try hitting the 'run' button above",
    "-- when you're done, tap on the right margin to go to the next example",
    '2+3'
    },
    {
    '-- print() calls show up in the area below',
    "-- hit 'run' and then scroll through the results",
    'for i=1,20 do print(i) end',
    },
    {
    '-- you can draw on the screen',
    "-- after you hit 'run', try hitting 'hide'",
    'love.graphics.line(100,100, 200,300)'
    },
    {
    '-- some color',
    'love.graphics.setColor(1,0,0)',
    "love.graphics.rectangle('fill', 100,100, 200,300)",
    },
    {
    '-- a checkerboard',
    '-- notice Safe_width and Safe_height for the bounds of the screen',
    'n = 100',
    'for x=0,Safe_width,n do',
    ' for y=0,Safe_height,n do',
    ' if (x+y)/n%2 == 0 then',
    ' love.graphics.setColor(0.9, 0.7, 0.7)',
    ' else',
    ' love.graphics.setColor(0.7, 0.7, 0.9)',
    ' end',
    " love.graphics.rectangle('fill', x,y, n,n)",
    ' end',
    'end',
    },
    {
    '-- some abbreviations to reduce typing',
    'g = love.graphics',
    'points, line, rectangle, polygon, circle, arc, ellipse = g.points, g.line, g.rectangle, g.polygon, g.circle, g.arc, g.ellipse',
    'color, bgColor = g.setColor, g.setBackgroundColor',
    "-- enough abbreviations, let's draw",
    'color(1,0,0) bgColor(0,1,0)',
    'line(100,100, 200,300)',
    "circle('fill', 200,100, 30)",
    },
    {
    "-- over to you; hope you enjoy Carousel Shell!",
    '',
    }
    }
  • file addition: 0077-example_pane (----------)
    [4.2]
    example_pane = function(lines)
    local result = new_pane()
    result.editor_state.lines = load_array(lines)
    Text.redraw_all(result.editor_state)
    return result
    end
  • edit in 0011-on.initialize at line 8
    [6.2084]
    [2.2248]
    Panes = map(Example_panes, example_pane)