this.myscriptPad.mathCalculator.editorElement.editor.pointerEvents(stroke, false) to import strokes from a canvas but then I tried to manually convert them using
this.myscriptPad.mathCalculator.editorElement.editor.convert() to actual script but that doesn't seem to work. What could I possibly be missing? I tried to wait for idle too like so :
physically tapping on the screen does convert it.
Your use case is related to "Raw Content", see : https://developer.myscript.com/docs/interactive-ink/1.2/web/myscriptjs/import-and-export/#raw-ink-import
When you call the "editor.pointerEvents" method the stroke is immediately processed.
What you can do is to store your imported stroke into a variable and then call the "editor.pointerEvents(stroke)" method manually.
Let me know if this is usefull.
You misunderstood my question. The adding strokes to myscript works. Its changing them to actual text that doesnt. Here is my code in more detail:
I have a timeline when a stroke is inputed on to myscript and on that timeline I also have an event when I want to change it actual text using convert.
So this function works:
const processGestures = true;
it successfully adds the user input to myscript.
but then my other function to convert that user input doesnt work:
I used waitingforIdle function too but that didnt help either. Changing var ProcessGestures to any value doesn't help either. But I'm more confused why convert() didnt work.
Here is one of my inputted strokes:
Thanks again for you help,
I forgot to add that I call pointerEvents once for each stroke that the user makes, so I call that function multiple times.
I figured it out, I need to shoot custom pointer events because all my listeners are based on pointers and not mouse.
Thank you for the update, we are glad you solved your issue!