+ -- 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!",
+ '',
+ }
+ }