fonts with specific letters, not entire alphabet

Discussion in 'Programming' started by bsabiston, May 26, 2018.

Tags:
  1. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    If you want to create a font with just specific letters, like for a giant title, do you have to add ranges for each letter if they aren't next to each other in the alphabet? And do you have to figure out yourself what the ASCII values are? Isn't there some way of just typing, for example "MY TITLE" in there and having it add just those letters? There must be, I just am not seeing it...
    Thanks for any help!
     
  2. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    Yep... just as you described. Clear the ranges out, add a new one and type in what you want.

    upload_2018-5-26_16-43-4.png
     
  3. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Isn't that GMS 1.4? My GMS 2 doesn't look like that.
     
  4. CMAllen

    CMAllen Member

    Joined:
    Mar 2, 2017
    Posts:
    831
    Alternatively, use font_add_sprite_ext() function. You can use that to create a custom font (note: run-time functionality only) from a sprite asset and define what characters are in the font and in what order. Easy, peasy. This can also be used to create highly-stylized fonts and non-text characters (like a [Shop] button image).
     
  5. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Anyone know how to do this? I did it at one point, but now have forgotten. There's a way to do it in the IDE.
     
  6. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    1,836
    1. Double-click the font in the resource tree.
    2. Delete existing range.
    3. Add your custom range.
    upload_2018-12-16_22-51-38.png
     
  7. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Thanks but that doesn’t work - it adds the entire range of letters between your highest and lowest characters. For instance if you just wanted A and M, you would get the whole alphabet between A and M.

    I tried everything I could think of and eventually had to add a single character range for every character in my title by looking up the ascii. Can’t believe they make this so hard.
     
  8. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    Doesn't my example work? You simply remove all ranges and type the letters you want in.
     
  9. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    No - as I say, it adds the entire range of the alphabet which includes the letters you type and every letter in between.
     
  10. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    Did a quick test by adding the word Test to a new font. It created two ranges, one for E, and one for ST. It's a little different in GMS2 apparently but it should look like this if you do it right. Click add range, type the letters, click add range button on the right.

    upload_2018-12-16_13-53-20.png
     
  11. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    What, you’re in GMS 1? Yeah I know that’s how it USED to work. It doesn’t do that in GMS 2.
     
  12. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    The screenshot I just posted was GMS2.
     
  13. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Wait I’m confused. If you tried it in GMS 2, why did you say “it’s a little different in GMS2 apparently”? I tried it many times yesterday with the latest version and it didn’t work for me. Tried it with the ‘use file’ option too where I just made a file with my title in it. Didn’t work.
     
  14. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    5,873
    Why don't you just make a Sprite out of the entire title? It's a lot more memory for game maker to draw a string of characters than it is for it to draw one single image, and by the sounds of it you only need it for one single image.
     
  15. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    I don't think that is true about the amount of memory required - besides, I do animated effects with the different letters. Anyway as I said I did get it to work by manually specifying a separate range for each individual character. I just wondered if this feature in GMS2 is broken or if there is some secret way to do it that I could not figure out.
     
  16. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    My first post (way back when) was in GMS1. The screenshot today was me just trying it out in GMS2 and yes it's different but it completely, totally works...
     
  17. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Well it doesn’t work for me, I tried it every way I could think of
     
  18. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    See if this helps....

    [​IMG]
     
  19. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Yeah that’s what I did - I don’t know why it isn’t working. Like I said in the original post I’m pretty sure it worked before. Maybe just need to restart my computer.
     
  20. bsabiston

    bsabiston Member

    Joined:
    Jun 21, 2016
    Posts:
    188
    Lol well today it will not even make a range at all! I recorded a gif but it says it is too large. You can see it here:
    https://gph.is/2LmC5YN
     
  21. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,270
    That's crazy. I'm sure you've tried restarting. A different font. Assign it to a different texture group, etc. But you've got some kind of bug going on there... no wonder you are frustrated lol. Doing it all right. :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice