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
var Replace2CanvasFont = pc.createScript('replace2canvasFont'); | |
// initialize code called once per entity | |
Replace2CanvasFont.prototype.initialize = function() { | |
this.app.root.findComponents('element').forEach(function(elm){ | |
if(elm.type === 'text') { | |
var font = new pc.CanvasFont(pc.app, { | |
fontName: 'UD Digi Kyokasho N-R, Helvetica, arial, sans-serif', | |
fontSize: 128, | |
}); |