Flash fonts and dialogs

Discussion in 'Game Development (Technical)' started by lennard, Feb 7, 2011.

  1. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,388
    Likes Received:
    12
    Does anybody use a good font, button and dialog package for Flash? Before rolling my own (future usage, not for Dungeon Brawl) I'd like to at least know of anything that people think is great.
     
  2. andrew

    andrew New Member

    Joined:
    Jan 14, 2007
    Messages:
    487
    Likes Received:
    0
    I don't know of any, I've been rolling my own as well. I've been thinking for a while about making a nice reusable package that other people could use. Flex MXML controls do have a lot of features, but they're hard to style and introduce all the extra Flex overhead.

    - andrew
     
  3. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,183
    Likes Received:
    0
    Roll my own as well. They're just sprite (so I can set buttonMode to true) containers with event handlers. For simple Flash games you don't need anything too complicated, though for an RPG I suppose it would be handy to construct more complex dialogs.
     
  4. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,388
    Likes Received:
    12
    Are you using standard fonts or something more exotic?

    I still use my Font Fiend tool and could use that with Flash somehow. I was trying to go quick and dirty with Dungeon Brawl but as that project has gone on I've regretted the decision not to have some way to get decent looking text into the game without building an image every time. Maybe I should add an output option to FF that would output a single PNG image with offsets and kerning info.
     
  5. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,183
    Likes Received:
    0
    I just embed the TTF file and use TextField.htmlText to render color, size, etc. I'm too lazy to use the TextFormat class (though to be honest htmlText does everything I need it to do anyway).

    Making a bitmap font is totally unnecessary and wasteful in Flash, unless that's your only option.
     
  6. andrew

    andrew New Member

    Joined:
    Jan 14, 2007
    Messages:
    487
    Likes Received:
    0
    Oh, yeah, bitmap fonts are a complete waste of time. TextField is built to do TTF rendering with sub-pixel antialiasing. You just embed your font and you're good to go, it's the one thing Flash does really well.

    - andrew
     
  7. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,388
    Likes Received:
    12
  8. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,183
    Likes Received:
    0
    Probably GlowFilter. You can add it to any display object's .filters array.
     
  9. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,388
    Likes Received:
    12
    Wasn't aware of that, looks pretty sweet. After I get this weeks DB level put together I'm going to mess around with that.

    Is there any kind of a shader that I can apply? I usually build my bitmapped fonts with vertically based shaders that interpolate between color/alpha channel values. Texturing would be handy too if that's kicking around.

    Thanks for the tip.
     
  10. andrew

    andrew New Member

    Joined:
    Jan 14, 2007
    Messages:
    487
    Likes Received:
    0
    Yeah, that was a glow filter... I just did a looping timeline animation done in CS4.

    However you can add filters dynamically to just about anything, MovieClip, TextField, etc ... movieClip.someTextField.filters = [ new GlowFilter(color, alpha, blurX, blurY, etc etc) ];

    (Note that the filters variable is actually an array, thus the [] around the new)

    - andrew
     
  11. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    yah..dont use bitmap fonts. I've learned that the hard way when all of a sudden a client wants support for different languages. ;)
     
  12. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,388
    Likes Received:
    12
    I like using Font Fiend because it gives me some extra effects but it is a hassle to keep building font strings that way. Guess it's time to move on - I'll start my next project by messing around with all of this stuff and building myself a little font/button/dialog tool kit.
     
  13. andrew

    andrew New Member

    Joined:
    Jan 14, 2007
    Messages:
    487
    Likes Received:
    0
    If you wanted to replicate the Dungeon Brawl effect with vector fonts, you could do it with masks:

    - Create a rectangle that has the vertical color gradient, sized to the height of the text line
    - Use a text field as the mask (i.e. rectangleObject.mask = textField)

    You could then attach glows/drop shadows if you want, etc. Would be easiest to set it up in Flash CS5 as layers so that you could see exactly what it looks like first, then just set the text field to dynamic, embed the fonts, and you're good to go.

    Could probably also do it with PixelBender if you wanted a more shader-like way to approach it. Just remember it's not hardware accelerated so you need to keep it fairly optimized.

    - andrew
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer