Created
April 15, 2017 15:19
-
-
Save GerkinDev/cdcb0beabc0ef7ae2a5e0a5e4d31b277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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