Skip to content

Instantly share code, notes, and snippets.

@GerkinDev
Created April 15, 2017 15:19
Show Gist options
  • Save GerkinDev/cdcb0beabc0ef7ae2a5e0a5e4d31b277 to your computer and use it in GitHub Desktop.
Save GerkinDev/cdcb0beabc0ef7ae2a5e0a5e4d31b277 to your computer and use it in GitHub Desktop.
function markdown_to_pixi(input, sketch, options, baseStyle){
var parser = new markdown_it(),
html_str = parser.render(input),
pixi_text = new pixi_multistyle_text(html_str, {
"default": baseStyle,
"p": {},
"em": {
fontStyle: "italic",
},
"strong": {
fontWeight: "bold",
},
});
$.extend(pixi_text, options);
sketch.stage.addChild(pixi_text);
sketch.renderer.render(sketch.stage);
return pixi_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment