5 Replies Latest reply on Dec 7, 2017 3:36 PM by ClayUUID

    Parsing Twitch.tv Emotes in Animate CC?


      Hello, I'm currently working a simple chat overlay in Animate CC. I have everything all set up except parsing the Twitch emotes. Obviously it is a case of iterating over the text and matching the keys to the appropriate images, which I have the JSON files for, however I'm not exactly sure how to actually embed the images within the text. I've searched over other emote questions however they all refer to using the <img> tag which is an HTML thing so I don't think I can do that directly inside Animate.

      For instance, it would usually be something like:


      tempMsg[i] = '<img src="' + emotes.get( tempMsg[i] ) + '">';


      A function of which might return something like

      <img class="emoticon" src="http://static-cdn.jtvnw.net/emoticons/v1/356/3.0"> haha <img class="emoticon" src="http://static-cdn.jtvnw.net/emoticons/v1/25/3.0"> lel


      But in Animate the result doesn't display an image, it just shows the entire <img src> link inside the text. I'm guessing I need to use ctx.drawImage somehow, but then I have to worry about how to draw it into the right place in the message? Any advice would be greatly appreciated, thank you!