dchhetri Posted December 10, 2013 Share Posted December 10, 2013 For example, maybe give a text object some bound and wrap text to that bound? Link to comment Share on other sites More sharing options...
XekeDeath Posted December 10, 2013 Share Posted December 10, 2013 You can pet some properties on the style of the text to wrap it.var style = { //usual style things here wordWrap: true, wordWrapWidth: 500 //Your bounding width here.}; Link to comment Share on other sites More sharing options...
dchhetri Posted December 10, 2013 Author Share Posted December 10, 2013 Quick question, do we have some animation manager that renders text with delay per character. Wondering if there exist something before I go an write it up. Link to comment Share on other sites More sharing options...
XekeDeath Posted December 10, 2013 Share Posted December 10, 2013 Quick question, do we have some animation manager that renders text with delay per character. Wondering if there exist something before I go an write it up. If there is, I have not seen it at all, so I'm gonna say no to that one. Link to comment Share on other sites More sharing options...
Mike Posted December 10, 2013 Share Posted December 10, 2013 Quick question, do we have some animation manager that renders text with delay per character. Wondering if there exist something before I go an write it up. http://www.gametest.mobi/phaser/examples/_site/view_full.html?d=text&f=kern+of+duty.js&t=kern%20of%20duty - isn't this what you looking for ? Link to comment Share on other sites More sharing options...
dchhetri Posted December 10, 2013 Author Share Posted December 10, 2013 http://www.gametest.mobi/phaser/examples/_site/view_full.html?d=text&f=kern+of+duty.js&t=kern%20of%20duty - isn't this what you looking for ? Yes, I just created a simple animation helper todo this. //shows word by word animateTextShow: function(textObject,message,fps){ if(!fps || fps == 0){ textObject.setText(message); }else{ var nextWordIndex = 1; var id; var words = message.split(' '); id = setInterval(function(){ textObject.setText(words.slice(0,nextWordIndex).join(' ')); ++nextWordIndex; if(nextWordIndex >= words.length){ clearInterval(id); } },1000/fps); } } Mike and shawnbless 2 Link to comment Share on other sites More sharing options...
pimbel Posted February 19, 2014 Share Posted February 19, 2014 You can pet some properties on the style of the text to wrap it.var style = { //usual style things here wordWrap: true, wordWrapWidth: 500 //Your bounding width here.};Thanks for this suggestion? I have a related question: the suggestion above works great, but it also wraps the words (it breaks the words). Is there a way to wrap the sentence but not the words? (just started html5, so forgive if I'm asking really dumb things here..)i've tried to do it in CSS as well (style = { width: "500px" }; , but that doesn't work. Suggestions? Thanks in advance! Link to comment Share on other sites More sharing options...
XekeDeath Posted February 20, 2014 Share Posted February 20, 2014 We rolled our own text class here because we needed to do some other fancy things with text. Wrapping on words was one of them. My basic early "good enough for now" solution basically tracked back from the character that PIXI tried to wrap on, and find the first space character and change the wrap point to that instead. Note: Looking at the Phaser 1.2 code for the Text class, it looks like it wraps on words. Link to comment Share on other sites More sharing options...
Recommended Posts