2022-05-18 05:18:17 +01:00
|
|
|
function draw_help_without_mouse_pressed(drawing)
|
|
|
|
love.graphics.setColor(0,0.5,0)
|
|
|
|
local y = drawing.y+10
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("Things you can do:", 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
love.graphics.print("* Press the mouse button to start drawing a "..current_shape(), 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-06-05 05:48:35 +01:00
|
|
|
love.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-06-05 05:48:35 +01:00
|
|
|
love.graphics.print("then press the mouse button to drop it", 16+30+bullet_indent(),y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-06-05 05:58:06 +01:00
|
|
|
love.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
|
|
|
love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
if Current_drawing_mode ~= 'freehand' then
|
2022-06-03 07:55:17 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'line' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'manhattan' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'circle' then
|
2022-06-05 04:35:31 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'polygon' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
2022-05-18 23:29:18 +01:00
|
|
|
if Current_drawing_mode ~= 'rectangle' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 23:29:18 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'square' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+s' to switch to drawing squares", 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
end
|
2022-06-05 05:58:06 +01:00
|
|
|
love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-06-05 05:58:06 +01:00
|
|
|
love.graphics.print("Press 'esc' now to hide this message", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
love.graphics.setColor(0,0.5,0, 0.1)
|
2022-05-21 16:10:11 +01:00
|
|
|
love.graphics.rectangle('fill', 16,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function draw_help_with_mouse_pressed(drawing)
|
|
|
|
love.graphics.setColor(0,0.5,0)
|
|
|
|
local y = drawing.y+10
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
love.graphics.print('Things you can do now:', 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
if Current_drawing_mode == 'freehand' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print('* Release the mouse button to finish drawing the stroke', 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
elseif Current_drawing_mode == 'line' or Current_drawing_mode == 'manhattan' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print('* Release the mouse button to finish drawing the line', 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
elseif Current_drawing_mode == 'circle' then
|
|
|
|
if drawing.pending.mode == 'circle' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print('* Release the mouse button to finish drawing the circle', 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
love.graphics.print("* Press 'a' to draw just an arc of a circle", 16+30,y)
|
2022-05-18 05:18:17 +01:00
|
|
|
else
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print('* Release the mouse button to finish drawing the arc', 16+30,y)
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
elseif Current_drawing_mode == 'polygon' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print('* Release the mouse button to finish drawing the polygon', 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
love.graphics.print("* Press 'p' to add a vertex to the polygon", 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
end
|
|
|
|
love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", 16+30,y)
|
|
|
|
y = y + Line_height
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
if Current_drawing_mode ~= 'line' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'l' to switch to drawing lines", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'manhattan' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'circle' then
|
2022-06-05 04:35:31 +01:00
|
|
|
love.graphics.print("* Press 'o' to switch to drawing circles/arcs", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'polygon' then
|
2022-06-03 07:36:07 +01:00
|
|
|
love.graphics.print("* Press 'g' to switch to drawing polygons", 16+30,y)
|
|
|
|
y = y + Line_height
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
2022-05-18 23:29:18 +01:00
|
|
|
if Current_drawing_mode ~= 'rectangle' then
|
2022-06-05 04:25:41 +01:00
|
|
|
love.graphics.print("* Press 'r' to switch to drawing rectangles", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 23:29:18 +01:00
|
|
|
end
|
|
|
|
if Current_drawing_mode ~= 'square' then
|
2022-06-05 04:25:41 +01:00
|
|
|
love.graphics.print("* Press 's' to switch to drawing squares", 16+30,y)
|
2022-06-03 07:36:07 +01:00
|
|
|
y = y + Line_height
|
2022-05-18 23:29:18 +01:00
|
|
|
end
|
2022-05-18 05:18:17 +01:00
|
|
|
love.graphics.setColor(0,0.5,0, 0.1)
|
2022-05-21 16:10:11 +01:00
|
|
|
love.graphics.rectangle('fill', 16,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))
|
2022-05-18 05:18:17 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function current_shape(shape)
|
|
|
|
if Current_drawing_mode == 'freehand' then
|
|
|
|
return 'freehand stroke'
|
|
|
|
elseif Current_drawing_mode == 'line' then
|
|
|
|
return 'straight line'
|
|
|
|
elseif Current_drawing_mode == 'manhattan' then
|
|
|
|
return 'horizontal/vertical line'
|
|
|
|
elseif Current_drawing_mode == 'circle' and shape and shape.start_angle then
|
|
|
|
return 'arc'
|
|
|
|
else
|
|
|
|
return Current_drawing_mode
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
_bullet_indent = nil
|
|
|
|
function bullet_indent()
|
|
|
|
if _bullet_indent == nil then
|
|
|
|
local text = love.graphics.newText(love.graphics.getFont(), '* ')
|
|
|
|
_bullet_indent = text:getWidth()
|
|
|
|
end
|
|
|
|
return _bullet_indent
|
|
|
|
end
|