Sign in to follow this  
SelethD

custom input box

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.


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