Skip to content

Commit 9818218

Browse files
committed
Added basic sketch
1 parent 226aa79 commit 9818218

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const fs = require('fs');
2+
3+
let version
4+
function setup() {
5+
createCanvas(400, 400);
6+
7+
// Read a file (for example, package.json)
8+
fs.readFile('package.json', 'utf8', (err, data) => {
9+
if (err) {
10+
console.error('Error reading file:', err);
11+
return;
12+
}
13+
var json = JSON.parse(data)
14+
version = json.version;
15+
});
16+
}
17+
18+
function draw() {
19+
background(220);
20+
21+
textAlign(CENTER)
22+
text(`I'm version ${version}`, width / 2, height / 2)
23+
}

src/main/kotlin/p5jsEditorToolbar.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class p5jsEditorToolbar(editor: p5jsEditor?) : EditorToolbar(editor) {
99
val editor = editor as p5jsEditor
1010

1111
editor.scope.launch {
12-
editor.sketch.save()
1312
editor.processes.forEach { it.destroy() }
1413
runButton.setSelected(true)
1514
editor.runNpmActions(editor.sketch.folder, p5jsEditor.TYPE.npx, listOf("electron", ".")){

0 commit comments

Comments
 (0)