Theory on Creating and Using Custom Fonts in GS for Simple Things Like Name Entry

dotsonj23dotsonj23 Member Posts: 316
edited December 2011 in Working with GS (Mac)
FYI, I think I know a way to do custom fonts but you can't use the iOS keyboard to do it but would rather have to use the old method of creating your own keyboard. It would also entail a lot of game.attributes if doing anything other than allowing the user to enter a name or a couple of words. And I expect setting it up to do anything more than two or three 8 letter words would heavily tax the system resources. The basic idea is use the keyboard example out there already. Create a game.attribute (integer) called "#ofLetters". Now create 8 images in photoshop without any actual image (i.e., just blank projects/images with alpha set at 0) and import those into GS and create 8 actors with them (call them Letter 1, Letter 2, Letter 3, etc..... Now place them each in the scene in order where you want them (they won't initially be visible since they are blank and alpha is 0). Then create the images to be used for your fonts for all letters and save them like this A.png, B.png, C.png, etc.... and import into GS. Now create rules for each letter on the keyboard, when touched --> change game.#ofLetters to game.#ofLetters+1. Then create rules within each actor/letter on the keyboard like this: (example is for the letter D) when touched & when game.#ofLetters =1 --> change attribute scene.layer.[whatever layer your 8 actors are on].Letter1.Image to D. That will effectively change the image for the first Letter Actor (Letter 1) to the D.png image. You would then need to set up seven more similar rules in the D keyboard actor for when game.#ofLetters=2, 3, 4, 5, 6, 7, or 8. You would also need to do this for every key on the keyboard. But I believe doing this would allow you to create your own fonts and allow user input to enter names or short sentences. (Note a "space" would not require a change image because you would want the image to remain blank). One issue with this approach is that if you do not use a font that is proportional (forget the term) you will likely have spacing issues, although you could probably create rules to deal with that as well (but again that would likely get rule intensive). This is all theoretical since I don't particularly need custom fonts at this point in my game but if anyone tries it and it works (or works with some modification) it would be nice if you posted about your experience.

I also posted the above in the Sticky about what features we want under my requested feature for a Font Editor (as originally suggested by Tshirtbooth) but after thinking about it thought it would be more appropriate to post under this category in case anyone had any comments, ideas, etc.... Thus, any Sous or Head Chef should feel free to delete that portion of my post in the sticky as I believe its in the wrong place.

Comments

  • ultimaultima Member, PRO Posts: 1,207
    the same method could be used with iOS keyboard keyboard as well (if GS gives a better looking and more integrated keyboard function) you can just load your own typeface or upload a typeface mapping for all of the characters... but i'm guessing they haven't figure out how to do it because they don't have a typography expert working there. proportional typefaces are called mono space. we could collaboratively just design a keyboard template to put up for everyone to use, one that acts like the iOS keyboard(because one that's available doesn't do that), one that has enlargement pop-up when you press a character. and just use DBA's project merger to "import" they keyboard into our project.

    i for one is really annoyed by the after thought looking full screen keyboard that seems like it has nothing to do with our project.

    p.s. and you are right without using a monospace typeface you would have to figure out the kerning set for all of the letter combination, and that's just insane. but luckily there's plenty of good looking monospace out there... the popular Courier for example is a beautiful one(well at least the more modern interpretation) .. so is almost all of the typewriter typefaces.
Sign In or Register to comment.