Results 1 to 4 of 4

Thread: user text input with delphiX and DXDraw surface

  1. #1

    user text input with delphiX and DXDraw surface

    Hi all,,,

    I want to get text input from the user while displaying other text on the DXDraw.surface...

    Now ideally I would like to use an Edit box.. and in fact, can do so in some circumstances.... by setting the focus to the editbox with Edit1.setfocus..

    But it does not work sometimes...

    What is the best way to achieve my desired text input in the above situation?? without having to process individual keystrokes...

    Or do I have to write a routine to process keystrokes with DXInput?

    cheeeeeeeeerrrrrrrrrssssssssss ato
    The Universe is all right here!!!

  2. #2

    user text input with delphiX and DXDraw surface

    Setting the focus to an edit component is a good idea. I've used it myself and it worked fine so you might want to find out why it doesn't work in the situations that you mentioned.
    Dealing with keystrokes i no biggy either, though. All you need is a string variable which will function as your type buffer. You don't even have to use DirectInput (unless you're already using it elsewhere in your game)... you can just use the OnKeyUp event of your form. Whenever the user presses a key, append that key to your string. If you want to simulate an input box, you'll also need a "cursorposition" variable which you initially set to "1" and increment whenever the user presses a key. If the user presses the left arrow key, you decrement that variable and if he presses the right arrow key, you increment it. Also handle Backspace/Delete and you get a fully functional edit box.
    Ask me about the xcess game development kit

  3. #3

    user text input with delphiX and DXDraw surface

    Hi Harry..

    Thx 4 reply,, yes well I am using dxinput anyway so until I find out why my editbox "dontwerk" i will just write the input routine...

    cheeeeeeeerrrrrrrrrsssssssssss a
    The Universe is all right here!!!

  4. #4

    user text input with delphiX and DXDraw surface

    Hi agin...

    SOLUTION ===

    hmmm , It seemed a much neater solution to use the Edit box, so I investigated further, and got it to work by including

    Application.Processmessages within the appropriate loop....

    The loop was a ( repeat until ) and was not getting messages from keydown events....

    cheeeeeeeerrrrrrsssssss ato
    The Universe is all right here!!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •