add an assert
[lines.love.git] / icons.lua
blobbc4955bf67774f0c075daf2bb27fa3c14225435b
1 icon = {}
3 function icon.insert_drawing(button_params)
4 local x,y = button_params.x, button_params.y
5 App.color(Icon_color)
6 love.graphics.rectangle('line', x,y, 12,12)
7 love.graphics.line(x,y+6, x+12,y+6)
8 love.graphics.line(x+6,y, x+6,y+12)
9 end
11 function icon.hyperlink_decoration(button_params)
12 local x,y = button_params.x, button_params.y
13 -- hack: set the hyperlink color so that caller can draw the text of the
14 -- hyperlink in the same color
15 App.color(Hyperlink_decoration_color)
16 love.graphics.line(x,y+Editor_state.line_height, x+button_params.w,y+Editor_state.line_height)
17 end
19 function icon.freehand(x, y)
20 love.graphics.line(x+4,y+7,x+5,y+5)
21 love.graphics.line(x+5,y+5,x+7,y+4)
22 love.graphics.line(x+7,y+4,x+9,y+3)
23 love.graphics.line(x+9,y+3,x+10,y+5)
24 love.graphics.line(x+10,y+5,x+12,y+6)
25 love.graphics.line(x+12,y+6,x+13,y+8)
26 love.graphics.line(x+13,y+8,x+13,y+10)
27 love.graphics.line(x+13,y+10,x+14,y+12)
28 love.graphics.line(x+14,y+12,x+15,y+14)
29 love.graphics.line(x+15,y+14,x+15,y+16)
30 end
32 function icon.line(x, y)
33 love.graphics.line(x+4,y+2, x+16,y+18)
34 end
36 function icon.manhattan(x, y)
37 love.graphics.line(x+4,y+20, x+4,y+2)
38 love.graphics.line(x+4,y+2, x+10,y+2)
39 love.graphics.line(x+10,y+2, x+10,y+10)
40 love.graphics.line(x+10,y+10, x+18,y+10)
41 end
43 function icon.polygon(x, y)
44 love.graphics.line(x+8,y+2, x+14,y+2)
45 love.graphics.line(x+14,y+2, x+18,y+10)
46 love.graphics.line(x+18,y+10, x+10,y+18)
47 love.graphics.line(x+10,y+18, x+4,y+12)
48 love.graphics.line(x+4,y+12, x+8,y+2)
49 end
51 function icon.rectangle(x, y)
52 love.graphics.line(x+4,y+8, x+4,y+16)
53 love.graphics.line(x+4,y+16, x+16,y+16)
54 love.graphics.line(x+16,y+16, x+16,y+8)
55 love.graphics.line(x+16,y+8, x+4,y+8)
56 end
58 function icon.square(x, y)
59 love.graphics.line(x+6,y+6, x+6,y+16)
60 love.graphics.line(x+6,y+16, x+16,y+16)
61 love.graphics.line(x+16,y+16, x+16,y+6)
62 love.graphics.line(x+16,y+6, x+6,y+6)
63 end
65 function icon.circle(x, y)
66 love.graphics.circle('line', x+10,y+10, 8)
67 end