custom input box

Started by
3 comments, last by SelethD 19 years, 7 months ago
I am making a game with DirectDraw. (I know, I know its old, but I already have a stable library for it so its easy :P ) Anyway, I need some way of doing input, like typing in the name of a player. How does everyone else deal with this issue, do you make your own? or is there somthing im missing that is built into windows that can help with this. Im working in fullscreen mode, so I dont think its possible to use a windows input box, or whatever there called, or if it is possible id like to know how. I have tried making my own, but it gets messy trying to know when a mouse is cliked on it, and if it has the keyboard focus, and stuff like that. please please help anyone
Advertisement
You'll need to create your own GUI system or use an external library to provide it.

A GDNet tutorial on making a GUI can be found here, but I think that as you're using DirectX, you'll benefit from looking at Crazy Eddie's GUI System, which is a fully-featured open source GUI system for DirectX and OGRE. It'll be easier than coding your own, but probably not as fun [wink]
Oh, believe me I have had 'plenty' of fun trying to make some type of gui.

However your link to the tutorial isnt good, so could you check it and re-post it? I would really like to see how other people do it.

For last resort I was going to use Crazy Eddie's but that site doesnt realy explain what you need to download, its a bit over my head, I searched around but couldnt find what I needed.
See if this helps.

Try breaking the problem down.

For any gui widget you only need to know a few things.
* where it is.
* how big it is.
*** is it the control we have focused.
@@@ extra widget specific data. (e.g Captions, Paint states {Pressed, checked, moving...}, user input space....)

It also has only a few basic functions.
* Init. Run once, befor we see it.
* Paint. The code that draws it to the screen.
* OnMouse. handles mouse stuff
* OnKey. handels keyboard stuff.
* DeInit. Clean up, after were finnished with it.
@@@ for extra marks, add in an update for animation stuff.

Control focus is special because You'll probably want it in a form or screen widget, it what allows you to send the mouse and key data to the active widget. It avoid some of the messynes.

Forms or Screens are just containers (arrays) for widgets.


Armand -------------------------It is a good day to code.
thanks for the advice, ill do some more searching, now I know what to search for 'gui'

thanks

This topic is closed to new replies.

Advertisement