Discord
Login
Community
DARK THEME

Drawing inside JS

I know I asked a similar question a short time ago, but I didn't fully understood the answers.

Can one u guys just show a little code snippet, where u somehow call the ms draw() function inside a //Javascript block. Hope this makes sense

Context:I want to make some calculations in Js, and parallel drawing the screen.

If your project has MicroScript 2.0 in the settings and only part of the code is written in Javascript, then in this part (file) at the top

// javascript

you must refer to all classes and functions that are in other files via global .

All classes and functions that you want to be visible in other files must be added to the global list.

(in the code there is an example of how classes and functions can be defined in two ways)

https://microstudio.io/i/Loginus/call_microscript/

If you write all your code in JavaScript, you refer to it without the word global .

https://microstudio.io/i/Loginus/call_javascript/

First, thx for your reply. My Problem: the changes with this are only applied, after the function ended. And after my js function is terminating, there is no need to draw, bc there the "normal" drawing is taking over

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community