Jump to content
  • Advertisement

Archived

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

slightlywhacked

text box's in dx

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

How would i go creating two text boxes in direct x, and place them in a particular position, and then when when the user presses enter, it reads the two strings into a string variable.. also is it possbile to make one of the text boxes to use those *** things (like when u type in a password) all of this has to be in direct x thanx

Share this post


Link to post
Share on other sites
Advertisement
DD or D3D?

either way the easiest thing to do is create an offscreen surface and blit to it using it's DC and windows GDI functions. These things aren't too speedy but they will let you toss some text on the screen quickly & easily. Then every frame, blt the offscreen surface to the desired spot on the primary.

Otherwise you have to write you own font engine, and implement your own edit box.

Edited by - Magmai Kai Holmlor on November 26, 2000 11:05:09 PM

Share this post


Link to post
Share on other sites
I think you mean an edit box. I know how to do it in just windows but not DX sorry

"People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face

Share this post


Link to post
Share on other sites
It doesnt use a hdc

this is for visual C++

you create an editbox (i just put one on a dialog box) call the dialog box and then in the dialog box procedure under IDOK: (or whatever message you need) you put

GetDlgItemText(hDlg, IDC_EDIT1, szBuffer, sizeof(szBuffer));

where hDlg is the handle to the dialog box,
IDC_EDIT1 is the identifier of the edit box,
szBuffer is where you want to put the string that the user inputs

As i said this doesnt use a hdc so i wont go further into it but if you need me to I will do.

hope i've helped at least slightly

Edited by - Zeke on November 29, 2000 8:28:21 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster


You can also create an edit box just like you create a normal window. Check out CreateWindow(Ex) in the Win32 API documentation.

If you have a windows handle, you can get its HDC. Check out GetDC(HWND) in the Win32 API documentation.


HTH -


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!