Jump to content

Sprite Font


jucarave
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...