Jump to content


Photo

font_add_sprite


  • Please log in to reply
8 replies to this topic

#1 Seamonster

Seamonster

    Meow!

  • New Member
  • 743 posts

Posted 20 August 2010 - 07:34 PM

Hai.
Since GM has a pretty poor text drawing function and I want drop shadow on some of my characters, I decided to use font_add_sprite.
I have two questions though.
The help file says:

first indicate the index of the first character in the sprite. For example, use ord('0') if your sprite only contains the digits.

If I want to have 0-9, A-Z and a-z, how would I use this then?
There is no description on what order the letters should be in.

Also, I want to be able to change the separation (Tracking and Kerning, preferably both) between the characters, how is this possible?
Proportional doesn't really work since M and I doesn't have the same width and a sprite can only be one size.

Thanks in advance! :)
/seamonster
  • 0

#2 Kaeru

Kaeru

    GMC Member

  • New Member
  • 675 posts

Posted 20 August 2010 - 07:38 PM

use the ASCII Order. you can also look into the charmap to see the order.

when you have 0-9, A-Z and a-z, you'll need to insert : ; < = > ? @ between 9 and A, and [ \ ] ^ _ ` between Z and a, and start with 0 = No. 48.

Edited by Kaeru, 20 August 2010 - 07:40 PM.

  • 0

#3 Seamonster

Seamonster

    Meow!

  • New Member
  • 743 posts

Posted 20 August 2010 - 08:59 PM

Okay, noted.
Though to save time and effort I want to export the characters from PSP and import it into GM and create a strip. But since all the characters in the font isn't as wide, there is a problem. Do anyone know how I can solve this? This has to be solved in PSP (or Photoshop or whatever) of course. I've tried separating the characters with both Tracking and Kerning but all characters isn't as wide still. Meaning there will be more spacing between two narrow characters than two wide.

TL DR; I want to put 0-9 : ; < = > ? @ A-Z [ \ ] ^ _ ` a-z where each character is put in a 15px wide "box" so I can easily create a sub images in GM from the image.

Edited by Seamonster, 20 August 2010 - 09:19 PM.

  • 0

#4 Kaeru

Kaeru

    GMC Member

  • New Member
  • 675 posts

Posted 20 August 2010 - 09:14 PM

font_add_sprite has a "proportional" flag, set it to true and the detected bounding box of the chars should make up the width of each char.
  • 0

#5 Seamonster

Seamonster

    Meow!

  • New Member
  • 743 posts

Posted 20 August 2010 - 09:39 PM

Yeah, but the problem is to get it out of my image editing program.
I could export each character at a time but that is a hell of an effort and takes a bit of time.
  • 0

#6 Kaeru

Kaeru

    GMC Member

  • New Member
  • 675 posts

Posted 20 August 2010 - 10:08 PM

ermn... export it as a png that has all chars in a row, like this one: http://gmc.yoyogames...dpost&p=3587237
  • 0

#7 Seamonster

Seamonster

    Meow!

  • New Member
  • 743 posts

Posted 21 August 2010 - 10:08 AM

Well, if I just export it in a long row and load it into GM, no characters except 0 works and the whole row is drawn...
  • 0

#8 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 17025 posts
  • Version:GM:Studio

Posted 21 August 2010 - 10:32 AM

No... Use the sprite create from strip option in a new sprite and you can choose the number of sub-images within a strip. Also, READ THIS POST as it may help you too...
  • 0

#9 Seamonster

Seamonster

    Meow!

  • New Member
  • 743 posts

Posted 21 August 2010 - 10:58 AM

Yeah, I had to have one character in each subimage.
Had some problems 'cause I couldn't get them lined up properly.
But there is some crazy whitespace between the characters now, even with proportional enabled.
Anyway to solve this without touching the sprite sheet? Maybe some script or something?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users