5 Replies Latest reply on Oct 27, 2015 5:34 AM by kglad

    Render text as html option dimmed in Canvas mode

    cresenture.54288517

      Does anyone know why is the Render text as html option dimmed in canvas mode?

      Need this option so that the text box I created able to get dynamic html content from server. Thanks

        • 1. Re: Render text as html option dimmed in Canvas mode
          kglad Adobe Community Professional & MVP

          easeljs doesn't support html text, yet.

           

          you can edit that in the published js file, though.

          • 2. Re: Render text as html option dimmed in Canvas mode
            cresenture.54288517 Level 1

            Do you mean the feature will be enabled in next patch?. As for now do you have any link for the editing of published js file?. Thanks in advance.

            • 3. Re: Render text as html option dimmed in Canvas mode
              kglad Adobe Community Professional & MVP

              i don't know when adobe plans on releasing that feature and i can't say much more because i'm under an nda.

               

              for patching your js file, create a text and enter some unique text.  then search your js file for:

               

              this.text = new cjs.Text('size','your unique text','font','color');

               

              this.text is the textfield you need to edit and you can use all the js properties and methods.  eg, i added hebrew (right to left and i don't have a hebrew keyboard):

               

              this.text = new cjs.Text('סמן עם אצבעך על המסך את האזור הרצוי לבודד. משקף התנודות יטפל בכל  השאר.', "30px 'Arial'", "#FFFFFF");

                  this.text.textAlign = 'right';

                  this.text.lineHeight = 32;

                  this.text.lineWidth = 292;

                  this.text.x = 292;

              • 4. Re: Render text as html option dimmed in Canvas mode
                cresenture.54288517 Level 1

                Thanks for the reply. As for the solutions provided, it does not work as we expected. We will continue searching for solution on our end. Thank you.

                • 5. Re: Render text as html option dimmed in Canvas mode
                  kglad Adobe Community Professional & MVP

                  you're welcome, but i'm not sure why that didn't help.

                   

                  here's more elaborate coding for a textfield allowing a typewriting effect with various html tags including italic:

                   

                  this.frame_10 = function() {

                          //      'Can you trigger an oscilloscope on this glitch in just one step?';

                          var s = 'האם תוכל לסנכרן את משקף התנודות לתקלה זו בצעד|אחד פשוט ?';

                          var newS = '';

                          var a = s.split('');

                          var i = 0;

                          //var tw_div = document.getElementById('tw_id');

                          tw_div.style.fontFamily="arial";

                          tw_div.style.color='#000000';

                          tw_div.style.top = '90px';

                          tw_div.style.left = '70px'

                          //tw_div.innerHTML = s;

                         

                          tl.addEventListener("tick", typewriterF);

                         

                          function typewriterF(e){

                              newS.split("<br/>").join("");

                              newS += a[i]+a[i+1];

                              newS = newS.split("|").join("<br/>");

                              tw_div.innerHTML = '<b><font size="6" family="arial">'+newS+'</font></b>';

                              //tw_div.innerHTML = tw_div.innerHTML.split(" glitch ").join(" <i>glitch</i> ");

                              //tw_div.innerHTML = tw_div.innerHTML.split(" | ").join("<br/>");

                             

                              i+=2;

                   

                              if(i>=a.length){

                                  tl.removeEventListener("tick", typewriterF);

                              }

                          }

                      }