-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw_constants.lua
60 lines (52 loc) · 1.9 KB
/
draw_constants.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local result = {}
result.BAR_HEIGHT = 3
result.NOTE_FONT_SIZE = 20
result.SMALL_NOTE_FONT_SIZE = 15
result.FONT_SIZE = 10
local function calculateOffset(size)
return -size * 2 - 0.5
end
result.NOTE_OFFSET = calculateOffset(result.NOTE_FONT_SIZE)
result.SMALL_NOTE_OFFSET = calculateOffset(result.SMALL_NOTE_FONT_SIZE)
result.NOTE_HEAD_BLACK = "";
result.NOTE_HEAD_HALF = "";
result.NOTE_QUARTER_UP = "";
result.NOTE_QUARTER_DOWN = "";
result.NOTE_HALF_UP = ""
result.STAFF = ""
result.G_CLEFF = ""
result.F_CLEFF = ""
result.ACCIDENTAL_DOUBLE_FLAT = ""
result.ACCIDENTAL_FLAT = ""
result.ACCIDENTAL_NATURAL = ""
result.ACCIDENTAL_SHARP = ""
result.ACCIDENTAL_DOUBLE_SHARP = ""
result.QUARTER_REST = ""
result.ACCIDENTALS = {
[-2] = "accidental double flat",
[-1] = "accidental flat",
[0] = "accidental natural",
[1] = "accidental sharp",
[2] = "accidental double sharp",
}
result.SYMBOLS = {
["note head black"] = result.NOTE_HEAD_BLACK,
["note head half"] = result.NOTE_HEAD_HALF,
["note quarter up"] = result.NOTE_QUARTER_UP,
["note quarter down"] = result.NOTE_QUARTER_DOWN,
["note half up"] = result.NOTE_HALF_UP,
["staff"] = result.STAFF,
["g cleff"] = result.G_CLEFF,
["f cleff"] = result.F_CLEFF,
["accidental double flat"] = result.ACCIDENTAL_DOUBLE_FLAT,
["accidental flat"] = result.ACCIDENTAL_FLAT,
["accidental natural"] = result.ACCIDENTAL_NATURAL,
["accidental sharp"] = result.ACCIDENTAL_SHARP,
["accidental double sharp"] = result.ACCIDENTAL_DOUBLE_SHARP,
["quarter rest"] = result.QUARTER_REST,
}
result.note_font = love.graphics.newFont("Bravura.otf", result.NOTE_FONT_SIZE)
result.small_note_font = love.graphics.newFont("Bravura.otf", result.SMALL_NOTE_FONT_SIZE)
result.text_font = love.graphics.newFont("leaguespartan-bold.ttf", result.FONT_SIZE)
result.mono_font = love.graphics.newFont("Courier.dfont", result.FONT_SIZE)
return result