online contextual help
[?]
May 15, 2022, 10:55 PM
JS6JSYOTXVZRN4XN7TYDY4GCNCFQBSERBPXEJ2TR5A2ITA6JJT2QCDependencies
- [2]
FBDRL6LHdelete points or shapes - [3]
CXCAERTBicons for current_mode - [*]
OTIBCAUJlove2d scaffold - [*]
2FMZNSD7experiment: only show drawing borders when they can be edited - [*]
JVRL5TWLstore device-independent coordinates inside drawings - [*]
ZD63LJ2Tbugfix: keep the click to create a new drawing from creating a new shape in the drawing - [*]
WDWXNW7Vslightly strange way to move points - [*]
H7OEU6WPexperimental approach to combining keyboard and mouse while drawing
Change contents
- edit in main.lua at line 97
if love.mouse.isDown('1') and love.keyboard.isDown('h') thendraw_help_with_mouse_pressed(line)returnend - edit in main.lua at line 104
if line.show_help thendraw_help_without_mouse_pressed(line)returnend - edit in main.lua at line 610
endelseif chord == 'C-h' and not love.mouse.isDown('1') thenlocal drawing = select_drawing_at_mouse()if drawing thendrawing.show_help = true - edit in main.lua at line 616[9.1072][10.482]
elseif chord == 'escape' and not love.mouse.isDown('1') thenlocal drawing = select_drawing_at_mouse()if drawing thendrawing.show_help = falseend - edit in main.lua at line 902
endfunction draw_help_without_mouse_pressed(drawing)love.graphics.setColor(0,0.5,0)love.graphics.rectangle('line', 16,drawing.y, drawingw,pixels(drawing.h))local y = drawing.y+10love.graphics.print("Things you can do:", 16+30,y)y = y+15love.graphics.print("* Press the mouse button to start drawing a "..current_shape_singular(), 16+30,y)y = y+15love.graphics.print("* Hover on a point and press 'ctrl+v' to start moving it,", 16+30,y)y = y+15love.graphics.print("then press the mouse button to finish", 16+30+bullet_indent(),y)y = y+15love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", 16+30,y)y = y+15y = y+15if current_mode ~= 'freehand' thenlove.graphics.print("* Press 'ctrl+f' to switch to drawing freehand strokes", 16+30,y)y = y+15endif current_mode ~= 'line' thenlove.graphics.print("* Press 'ctrl+l' to switch to drawing lines", 16+30,y)y = y+15endif current_mode ~= 'manhattan' thenlove.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", 16+30,y)y = y+15endif current_mode ~= 'circle' thenlove.graphics.print("* Press 'ctrl+c' to switch to drawing circles/arcs", 16+30,y)y = y+15endif current_mode ~= 'polygon' thenlove.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", 16+30,y)y = y+15endendfunction draw_help_with_mouse_pressed(drawing)love.graphics.setColor(0,0.5,0)love.graphics.rectangle('line', 16,drawing.y, drawingw,pixels(drawing.h))local y = drawing.y+10love.graphics.print("You're currently drawing "..current_shape_pluralized(), 16+30,y)y = y+15love.graphics.print('Things you can do now:', 16+30,y)y = y+15if current_mode == 'freehand' thenlove.graphics.print('* Release the mouse button to finish drawing a freehand stroke', 16+30,y)y = y+15elseif current_mode == 'line' or current_mode == 'manhattan' thenlove.graphics.print('* Release the mouse button to finish drawing a line', 16+30,y)y = y+15elseif current_mode == 'circle' thenif drawing.pending.mode == 'circle' thenlove.graphics.print('* Release the mouse button to finish drawing a full circle', 16+30,y)y = y+15love.graphics.print("* Press 'a' to draw just an arc of a circle", 16+30,y)elselove.graphics.print('* Release the mouse button to finish drawing an arc', 16+30,y)endy = y+15elseif current_mode == 'polygon' thenlove.graphics.print('* Release the mouse button to finish drawing a polygon', 16+30,y)y = y+15love.graphics.print("* Press 'p' to add a vertex to the polygon", 16+30,y)y = y+15endy = y+15if current_mode ~= 'line' thenlove.graphics.print("* Press 'l' to switch to drawing lines", 16+30,y)y = y+15endif current_mode ~= 'manhattan' thenlove.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", 16+30,y)y = y+15endif current_mode ~= 'circle' thenlove.graphics.print("* Press 'c' to switch to drawing circles/arcs", 16+30,y)y = y+15endif current_mode ~= 'polygon' thenlove.graphics.print("* Press 'g' to switch to drawing polygons", 16+30,y)y = y+15endendfunction current_shape_singular()if current_mode == 'freehand' thenreturn 'freehand stroke'elseif current_mode == 'line' thenreturn 'straight line'elseif current_mode == 'manhattan' thenreturn 'horizontal/vertical line'elsereturn current_modeendendfunction current_shape_pluralized()return current_shape_singular()..'s'end_bullet_indent = nilfunction bullet_indent()if _bullet_indent == nil thenlocal text = love.graphics.newText(love.graphics.getFont(), '* ')_bullet_indent = text:getWidth()endreturn _bullet_indent