After finding this thread: https://twinery.org/forum/discussion/3033/is-there-a-way-to-make-text-appear-as-rpg-games
I managed to get typed.js into my Harlowe twine using /u/TheMadExile 's example.
I have been trying to display typed out text after static text on the same line. The way to do this I think is through the css in the script:
I have changed the sections of style to this
I hope this has made a bit of sense, I'm struggling a little after plugging in different ideas. If there was a way to simply disable the wrapping function that would help but I can't seem to find it.
Thanks in advance
I managed to get typed.js into my Harlowe twine using /u/TheMadExile 's example.
I have been trying to display typed out text after static text on the same line. The way to do this I think is through the css in the script:
/*! typed.js integration module for Harlowe */ !function(){"use strict";var getInlineOptions=function(name){var match,options={},typedRe=/^typed(?:-(\w+))+\b$/,parseRe=/-(speed|delay)(\d+)\b/g;if("typed"!==name&&typedRe.test(name))for(;null!==(match=parseRe.exec(name));)switch(match[1]){case"speed":options.typeSpeed=+match[2];break;case"delay":options.startDelay=+match[2]}return options},typedCallbackFactory=function(el,callback){return function(){var $outer=jQuery(el),$inner=jQuery('<div class="typedjs-text-wrapper" style="display:block;position:absolute;left:0;top:0;"><span class="typed"></span></div>'),$source=$outer.children('tw-hook[name|="typed"]'),options=jQuery.extend({typeSpeed:40,startDelay:400},getInlineOptions($source.attr("name")),{strings:[$source.html()]});"function"==typeof callback&&(options.callback=callback),$outer.append($inner),$inner.children().typed(options)}};window.startTypedModule=function(){jQuery('tw-hook[name|="typed"]').addClass("typed").css("visibility","hidden").wrap('<div class="typedjs-outer-wrapper" style="display:block;position:relative;"></div>');for(var $elements=jQuery("tw-passage .typedjs-outer-wrapper"),callback=null,i=$elements.length-1;i>=0;--i)callback=typedCallbackFactory($elements[i],callback);"function"==typeof callback&&callback()}}();
I have changed the sections of style to this
style="display:inline-block;position:absolute;left:0;"and this
style="display:inline"respectively, and while the typing text now displays inline, it wraps to the next line way too early and moves half the line to the one below mid way through.
I hope this has made a bit of sense, I'm struggling a little after plugging in different ideas. If there was a way to simply disable the wrapping function that would help but I can't seem to find it.
Thanks in advance