Function to capture mouse position

This commit is contained in:
2023-08-03 00:06:10 +02:00
parent 4ae4b1c8d4
commit 405af94d16
2 changed files with 36 additions and 1 deletions

View File

@ -73,6 +73,28 @@ export class UserAPI {
this.load = samples("github:tidalcycles/Dirt-Samples/master");
}
// =============================================================
// Time functions
// =============================================================
get time(): number {
return this.app.audioContext.currentTime
}
// =============================================================
// Mouse functions
// =============================================================
get mouseX(): number {
return this.app._mouseX
}
get mouseY(): number {
return this.app._mouseY
}
// =============================================================
// Utility functions
// =============================================================