Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Todd Casey

Font System via DirectDraw

This topic is 6691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Currently I have a very simple font system that consists of a 256x256 bitmap of 16x16 characters (plain white courier new font). I want to expand this system so that it will display text that looks good on any resolution. I believe I need to create much larger characters so that they would look good in even a 1600x1200 resolution (maybe 64x64 characters). Then I can just scale them down to look proper on a 640x480 resolution (should this stretch blit be performed to create a new image or be done during the game each time one of the characters is displayed). I am also interested in modifying the color of the text. I know that I can lock down the surface and manually change the color bits of the entire font or manually blit the font and change the font color at runtime each time a character is displayed. What is the best approach to a system like this? I would like to use DirectDraw for my blitting since it may provide hardware acceleration (this would be the best approach wouldn’t it?). I also have a question about how games do the throbbing text effect where a text seems to go from a normal state to a glowing state and then back to the glowing state. Thanks for any information. Todd

Share this post


Link to post
Share on other sites
Advertisement
You should not scale the characters at runtime because that would be very time consuming.
One way you could do it is to have the bitmap at the highest resolution supported and when you load it in you check the current resolution and then load the characters to a temporary surface and then scale them down to a real surface. After this you delete the temporary surface and there you have your characters.

Another attempt would be to use bilinear filtering.
If you use this you can have the bitmap at a medium resolution and even if you enlarge the surface your characters won''t look pixelated.

If you wan''t to change the color of the characters you can use source color keying (or is it destination?).
This will only work if the part of the characters where the actual character is (I don''t know how to explain this better) has the same color all over.
So what you do is that you setup a colorkey where the color should be set to the color that your characters have (the character information part and not the background.).
Then if you wan''t a green character you blit a completely green surface on the charcter surface. Now only the color that has the colorkey will be green.

Hope you followed this.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!