Sign in to follow this  
JimmyRose

Writing Text

Recommended Posts

JimmyRose    109
Hello I'm wondering how do you write text to the screen and by that I don't mean output text like the DrawText() function but something where I can write on the screen while the program in running.

Share this post


Link to post
Share on other sites
Buckeye    10747
Quote:
I don't mean output text like the DrawText() function

Are you referring to GDI DrawText or ID3DXFont::DrawText?
Quote:
something where I can write on the screen while the program in running

Do you mean during rendering, between BeginScene() and EndScene()?

You can use the GDI DrawText after DirectX rendering, and ID3DXFont::DrawText during rendering.

Share this post


Link to post
Share on other sites
JimmyRose    109
I want something where the window would ask me my name and I would be able to put something. The reason is I want to make a chat client and this one of the things I need.

Share this post


Link to post
Share on other sites
Buckeye    10747
Since you posted to the DirectX/XNA forum, I assumed your question related to that.

Are you developing a Windows application? If so, why won't (GDI) DrawText work for you?

You can also use a dialog box.

Share this post


Link to post
Share on other sites
JimmyRose    109
I'm making a game with a chat client and I'm using DirectX as my wrapper that's why I wrote it here just because DirectX may have a way of doing it.

I never heard of (GDI) DrawText if that works that would be great.

I just wanted to get on the right path, I'll look it up thanks.

Share this post


Link to post
Share on other sites
Evil Steve    2017
You can use ID3DXFont to do what you need, but I'd recommend doing the input in plain Win32 with an edit control, and not using DirectX at all - you won't gain anything from using DirectX unless you want some sort of 3D graphics or high performance 2D going on.

Share this post


Link to post
Share on other sites
Tom KQT    1704
Just to prevent misunderstandings, JimmyRose - you want a textbox (or "editbox"), where the user of your application can type something, right?
If you'll try to make this in DirectX, for example using ID3DXFont, you'll have to program all the logic related to textboxes - text cursor and its movement via left and right keys, character deleting via backspace and delete, character adding etc etc etc. ID3DXFont will just help you to render the actual text content of the textbox, nothing more.

If you use the Win32 edit control, you'll get everything done for you "automatically".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this