skyvory / vn-canvas

Automatically exported from code.google.com/p/vn-canvas
0 stars 1 forks source link

Not exaclty a "problem" #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
So i have a problem, but its not with engine itself. I wrote a small function 
that should in theory display an autotype effect. However i cant seem to 
integrate it into the code successfully.
The code seems to work finde and the interval is started, but the text doesnt 
seem to be written.

I wasnt sure if i should have written a mail directly to oclabbao or post it 
here, so forgive me if i did wrong^^

Can someone help me ?

I know the code must look horrible to people well versed in Jscript, but i am 
novice in programming.

Line Quoute out of the canvastext-0.4.1.mod.js
Starts at line 543 since i was working only on the Left alignment case
"
else {
    //this.bufferContext.textAlign = 'start';
    //this.bufferContext.fillText(textLines[n].text, x, y);
    //original
    var thiscopy = this; 
    var myStri = textLines[n].text; 
    var myArr = []; 
    var counter5 = 0; 
    for(var t=0; t < myStri.length; t++){ 
    myArr.push(myStri[t]); 
    } //
    var autotype = setInterval(function(){letta(counter5)},20); 
        function letta(a){ 
        thiscopy.bufferContext.textAlign = 'start';
        thiscopy.bufferContext.fillText(myStri, x+(5*a), y); 
        counter5++; 
        if(myArr.length==counter5){clearInterval(autotype);} 
        }

}

"the guy with the problem"

Original issue reported on code.google.com by kollegex...@googlemail.com on 11 Oct 2014 at 8:29

GoogleCodeExporter commented 9 years ago
well at least i found out what is wrong.
Apparently the way it is written now the engine cannot handle drawing something 
more then once per text(param). However several text instances also wont work 
since they wipe the Scriptbox clean.

Anyone an idea on how to fix my dilemma ?

Original comment by kollegex...@googlemail.com on 17 Oct 2014 at 7:14

GoogleCodeExporter commented 9 years ago
Hi kollegex666,

Sorry, haven't checked the issues in a while.
Have you figured out a solution yet?

I can take a shot at it, but may take a while, as I'm working on another 
project.

Thanks!

Original comment by oclabbao on 4 Nov 2014 at 10:04

GoogleCodeExporter commented 9 years ago
If you take a look at "scroll" effect for the text, that's a continuous redraw 
of the ScriptBox, if I remember correctly. You could perhaps start with it and 
build from it. I'll try to squeeze some time and see if I can come up with a 
solution myself.

Btw, I'm changing it to type enhancement, as you say it's not exactly a 
problem. ;)

Original comment by oclabbao on 4 Nov 2014 at 11:10

GoogleCodeExporter commented 9 years ago
Update: See r101.

Original comment by oclabbao on 13 Nov 2014 at 2:10