Skip to content

Commit 2bac938

Browse files
committed
add debug doc
1 parent 98bd323 commit 2bac938

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

content/runal.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ All JavaScript [Math](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re
469469

470470
Runal **doesn't define trigonometry functions**, please use [_Math.sin()_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin), [_Math.cos()_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) etc...
471471
472+
In Go, use the [math](https://pkg.go.dev/math) package.
473+
472474
#### c.map(value, inputStart, inputEnd, outputStart, outputEnd)
473475
Maps a value from one range to another.
474476
@@ -576,23 +578,25 @@ Exports the current canvas to a mp4 (h264) video file for a given duration (in s
576578
#### c.savedCanvasFont(path)
577579
Sets a custom font (tff) file used for rendering text characters in exported images generated via _SaveCanvasTo...()_ methods.
578580
579-
### Log
581+
### Log & Debug
580582
581-
You can use JavaScript _console.log()_ to log things.
583+
You can use JavaScript _console.log()_ to log things on the screen.
582584
583585
```js
586+
584587
let x = Math.osc(c.framecount);
585588
console.log(x);
586589
```
587590
588-
Entries will be written in a **console.log** file in your current directory.
591+
In Go (and also in JavaScript), you can use _Debug()_:
592+
```go
589593
590-
You can display the logs live in another terminal pane with:
591-
```sh
592-
tail -f console.log
594+
x := math.Sin(float64(c.Framecount))
595+
c.Debug(x)
593596
```
594597
595-
The **console.log** file is deleted upon exit.
598+
#### c.debug(message1, message2, ...) <sub>since v0.9.0</sub>
599+
Print debug messages on screen.
596600
597601
### Events
598602

0 commit comments

Comments
 (0)