Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Hi. How do i make input boxes?

Author
Message
Mmjack
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location:
Posted: 9th Jul 2007 10:03
Hi, How do i make input boxes. say for a login screen. ive got most setup so far but i dont know how to make input boxes. so a player can Write his name before joining the game and have it above his head for the whole item Thanks for any help
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Jul 2007 16:34
There are a couple possibilities I think. One "GUI" tool is BlueGUI (I thinks its called) from The Game Creators, but last I knew they were still converting BlueGUI and other DBPro tools/Products to work with DarkGDK - so you might need to wait for BlueGUI for DarkGDK.

I'm not sure how DarkGDK gets that automatic starting point: void DarkGDK(void) - but this makes it difficult to make your own windows handler though I haven't tried.

You might be able to find a function called InputBox in the windwos API. I'm not sure if it exists but I think it does. It is like a message box except it has one input box in it and a OK and Cancel button. This, if available, would allow you to get a windows without needing to make a windows messaging loop (Which might be impossible under the way DarkGDK wraps the core of the windows looping and messaging stuff from you)

Lastly, you could make your own gui, using KEYSTATE to check for keypresses, or dbInkey for this purpose, and manually draw your input box, handle the cursor, handle backspaces, and draw it all yourself. This is probably the best way to go - and will allow you to stay pure DarkGDK for user input/output.

Others may have much better ideas than mine - but I'd thought I'd share my two cents.

Jason P Sage

Know way too many languages - Master of none
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2007 17:16
if youre using one of the dgdk's then you have all of windows programming tools at your disposal. why not take advantage of them? Like for a Login screen, why not make a form with standard labels and textboxes, and use that to gather the info from the user? At least thats how I do it in dgdk.net. I just add a Winform to my project and go from there, same as I would if I was writing an app having nothing to do with db_. Maybe c++ is diff, I wouldnt know too much about that, but it should be doable, no?

My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Jul 2007 20:22
I'm not sure. I DO KNOW that when you make a windows application, you always have a main function named " void main(void); " or simply "main". Using the DarkGDK, you need to start your program with a function named "void DarkGDK ( void )" or DarkGDK.

This implies that somehow, when you include the DarkGDK header/library, that the MAIN function is actually handled by DarkGDK, and after it initializes, it calls YOUR DarkGDK "main" function.

I suspect the normal hooks, message loop, etc, that you create normally have been already established by DarkGDK.

I also do NOT DOUBT the possibility of creating your windows and making them go to your own message handler, but at that point, you might be in a "multi-state" situation, and possibly Multi-threaded.

What I mean by this is that measures would have to be taken to make sure stuff that happens in your window is "READY" to be "read from" or exchanged with the Dark Side

Reason being is that your OWN WINDOW message loop can get called WHENEVER, and the code for it will need to be able to "syncronize" actions with the Dark Side - which can and will likely be happening in its own "world" timing wise. Once you create it window - it very much acts like a multi-threaded application - simply because the nature of an event driven operating system - which Windows is.

Any input from others who have experimented here would be appreciated. I'm spouting off theory - I haven't got "here" yet with my DarkGDK, if you know what I mean. I'm still making classes to handle my 3d "things", their movement ..if any, and collision etc. rtying to wwrap stuff into classes that I can use over and over. This is a project in it of itself for me.

(I know C++ but I'm not a guru in it - so I'm hitting a lot of learning curve - I usually try to stay away from it - but for Game programming - I think its much better than DBPro native... at least for elaborate games. DBPro is great but I find when you start getting fancy - its starts to dog out.)

Best Regards,

Jason P Sage

Know way too many languages - Master of none

Login to post a reply

Server time is: 2024-11-19 14:39:37
Your offset time is: 2024-11-19 14:39:37