Jump to content
  • Advertisement

Archived

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

Kavos

How do I allow text to be typed?

This topic is 6913 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

I'm wondering how to allow a player to type a message on the keyboard and have the letters show up on screen (fullscreen DDraw) as you type them. Can I have to use the GDI? Or do I have to code a system where I find the key pressed (using DInput), get that letter from a font bmp file, then blt it at the position needed. There must be an easier way... if not well, then i better get to work. ~Kavos Edited by - Kavos on 5/19/00 4:18:56 AM

Share this post


Link to post
Share on other sites
Advertisement
you have to use DInput or whatever you''re using for keyboard handling to figure out what the user is typing, but yeah you can use GDI to display the text.


--
Float like a butterfly, bite like a crocodile.

Share this post


Link to post
Share on other sites
Ok, but what is a fast way to use fonts with the GDI? There is a tutorial on gamedev.net but it also says that that method is quite slow and that there are better methods.

~Kavos

Share this post


Link to post
Share on other sites
quote:
Original post by Kavos

Ok, but what is a fast way to use fonts with the GDI? There is a tutorial on gamedev.net but it also says that that method is quite slow and that there are better methods.

~Kavos


GDI is slow, whatever you do with it. Moreover, displaying common fonts in a game doesn''t seem very pretty to me. You should perhaps make your own functions.

I''ll perhaps write a tutorial about fonts with directdraw. Perhaps when i''ll have improved my english...



Prosper / LOADED corporation

Share this post


Link to post
Share on other sites
Ok then just tell me basically how to do it, I can figure out the accually code for myself.

Share this post


Link to post
Share on other sites
Hi

I think the way it is mostly done, is to create an offscreen surface containing all the letters, and then use the Blitting Function to draw the Letters.
When also using D3D, you could use textured Quads, Without transforming the Vertices of course. You can also Use some kind of Text Buffer, when you have an longer text which is continually displayed. You can Blit all the Charakters to that Surface just once, and then use only one Blit to display the whole sentence.

Lars

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!