-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.js
More file actions
46 lines (36 loc) · 1.25 KB
/
template.js
File metadata and controls
46 lines (36 loc) · 1.25 KB
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
//----------------------------------------------------------------------------------------------------------------------
// Day X, Word: Description.
//----------------------------------------------------------------------------------------------------------------------
// Imports
const q = await Q5.WebGPU()
const FILE_TITLE = "DayXXWord"
const SIZE_WINDOW = 600
const HANDLE_RECORDER = createRecorder()
HANDLE_RECORDER.captureAudio = false
let FRAME_START = null
const FRAME_FPS = 60
const FRAME_END = FRAME_FPS * 5
//----------------------------------------------------------------------------------------------------------------------
// Classes
//----------------------------------------------------------------------------------------------------------------------
// Sketch Functions
q.setup = () => {
createCanvas(SIZE_WINDOW, SIZE_WINDOW);
}
q.draw = () => {
background("white");
if (recording && frameCount - FRAME_START === FRAME_END) {
saveRecording(FILE_TITLE)
pauseRecording()
}
}
q.mousePressed = () => {
if (!recording) {
FRAME_START = frameCount
record()
}
}
window.quit = function quit() {
canvas.remove()
}
//----------------------------------------------------------------------------------------------------------------------