jucarave Posted December 9, 2013 Share Posted December 9, 2013 Hello everyone, it's been a while... I am making a game and i need to implement a font from a spritesheet, i've been thinking of parsing the word and then drawing each part of the sprite but i need to know if there is a better way to achieve it. I am not using any framework. Greetings. Quote Link to comment Share on other sites More sharing options...
Rezoner Posted December 9, 2013 Share Posted December 9, 2013 I don't think so - you can cache the generated text in some offscreen canvas(es) tho. Quote Link to comment Share on other sites More sharing options...
@99golems Posted December 12, 2013 Share Posted December 12, 2013 ImpactJS does fonts like that. It stores the fonts in an image sheet, but instead of having frames that are all the same size, like in a traditional spritesheet, the font image has a 1px line at the bottom of each letter to represent how much space the letter should take. the engine then uses getImageData() to look at the bottom row of the font sheet to determine which letter is which. read more about it here: http://impactjs.com/documentation/class-reference/font Quote Link to comment Share on other sites More sharing options...
jucarave Posted December 13, 2013 Author Share Posted December 13, 2013 , that sounds actually pretty interesting... that would really help me although since i don't have so much time to deliver this game (it's for a contest) i think i will use the regular fillText function Greetings. Quote Link to comment Share on other sites More sharing options...
@99golems Posted December 16, 2013 Share Posted December 16, 2013 of course there's always phaser's own BitmapText. I'm still new to phaser so i didn't know about it until recently. if you have the phaser help docs on your localhost/webserver you can get more info here http://localhost/phaser/docs/Phaser.BitmapText.html Quote Link to comment Share on other sites More sharing options...
feiss Posted December 18, 2013 Share Posted December 18, 2013 Good link to doc: http://gametest.mobi/phaser/docs/Phaser.BitmapText.html Example: http://www.gametest.mobi/phaser/examples/_site/view_full.html?d=text&f=bitmap+fonts.js&t=bitmap%20fonts Quote Link to comment Share on other sites More sharing options...
BaronWilhelm Posted February 11, 2014 Share Posted February 11, 2014 I'm not sure I understood the question correctly, but I've used GlyphDesigner in the past to make custom fonts into spritesheets. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.