/
Stage.ts
67 lines (59 loc) · 1.55 KB
/
Stage.ts
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
61
62
63
64
65
66
67
import { chart } from '../chart.js'
import { panel } from '../panel.js'
import { print } from '../print.js'
import { skin } from '../skin.js'
export class Stage extends Archetype {
preprocessOrder = 1
preprocess() {
canvas.set({
scroll: Scroll.LeftToRight,
size: (panel.count * panel.w * screen.h) / 20,
})
}
render() {
this.renderPanels()
this.printTimes()
}
renderPanels() {
for (let i = 0; i < panel.count; i++) {
const x = i * panel.w
const b = 0
const t = panel.h
skin.sprites.stageMiddle.draw(
new Rect({
l: -1.5,
r: 1.5,
b,
t,
}).translate(x, 0),
0,
1,
)
skin.sprites.stageLeftBorder.draw(
new Rect({
l: -1.75,
r: -1.5,
b,
t,
}).translate(x, 0),
0,
1,
)
skin.sprites.stageRightBorder.draw(
new Rect({
l: 1.5,
r: 1.75,
b,
t,
}).translate(x, 0),
0,
1,
)
}
}
printTimes() {
for (let i = 1; i <= Math.floor(chart.duration); i++) {
print(i, i, PrintFormat.Time, 0, PrintColor.Neutral, 'left')
}
}
}