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 :
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.
Regards,
Maël
D
Daniel Kostinskiy
said
over 1 year ago
Hello mael,
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.
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.
Daniel Kostinskiy
Hello myscript,
I used
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 :
this.myscriptPad.mathCalculator.editorElement.editor.waitForIdle();
this.myscriptPad..mathCalculator.editorElement.editor.convert();
physically tapping on the screen does convert it.
Thanks,
Daniel
Dear Daniel,
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.
Regards,
Maël
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstDaniel Kostinskiy
using javascript for this.
John @MyScript
Dear Daniel,
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.
Regards,
Maël
Daniel Kostinskiy
Hello mael,
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:
addInk(strokes){
const processGestures = true;
this.myscriptPad.mathCalculator.editorElement.editor.pointerEvents(strokes, processGestures);
}
it successfully adds the user input to myscript.
but then my other function to convert that user input doesnt work:
convertInk(){
this.myscriptPad.mathCalculator.editorElemenet.editor.convert();
}
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,
Daniel
Daniel Kostinskiy
hello Mael,
I forgot to add that I call pointerEvents once for each stroke that the user makes, so I call that function multiple times.
Thanks,
Daniel
Daniel Kostinskiy
Hello again,
I figured it out, I need to shoot custom pointer events because all my listeners are based on pointers and not mouse.
Daniel
John @MyScript
Dear Daniel,
Thank you for the update, we are glad you solved your issue!
Best regards,
Maël