LLp Posted April 1, 2015 Share Posted April 1, 2015 I actually create an image with embedded text like this: GroupFactory.prototype.createImgFromImgAndText = function (type, text) {var dataImg = this.game.cache.getFrame(type), bmd;bmd = this.game.make.bitmapData(dataImg.width, dataImg.height);bmd.load(type);if (text === undefined) {return bmd;}bmd.ctx.fillStyle = "#000000";bmd.ctx.font = '25px san-serif';bmd.ctx.fillText(text, 10, 50);return bmd;}; How can I do this with a retro font ? This hasn't worked GroupFactory.prototype.createImgFromImgAndText = function (type, text) {var dataImg = this.game.cache.getFrame(type), bmd;bmd = this.game.make.bitmapData(dataImg.width, dataImg.height);bmd.load(type);if (text === undefined) {return bmd;}bmd.ctx.fillStyle = "#000000";bmd.ctx.font = this.game.add.retroFont('myfont', 60, 60, ",!?abcdefghijklmnopqrstuvwxyz.", 5, 0, 0, 0, 0);bmd.ctx.fillText(text, 10, 50);return bmd;}; Link to comment Share on other sites More sharing options...
Recommended Posts