Advertisement

Interface assistance. Picture included.

Started by February 20, 2000 03:22 PM
3 comments, last by LordDeath 25 years ago
I posted a question a while back about this but now I am going to get more specific. We are writing a simple strategy game, which is turn-based, for our senior design project. We have basically the whole game designed, and some of it implemented, except for the user interface. Nobody has done it and I''m not sure the best way to implement this. Hopefully, if the HTML works right, there should be a picture of one of our example screens below... Basically, for each screen in the game (there are 4 or 6 of them), we have a graphic .bmp file created.. The above is a .gif of our employee screen. Basically there are 4 main things I think we need for this interface. 1.) The background .bmp, which contains the background image, and the static text. 2.) The "value" text. This is text which is usually a number, which changes throughout the course of the game and will be printed overtop of the background .bmp An example of this in the picture is the "current hours" numbers for the employee. 3.) The screen-changing buttons. These are buttons (the 5 at the bottom are good examples) that when you click on them, the screen changes from the employee page, to whatever screen you clicked the button for (the bank screen, for example) 4.) The value-changing buttons. Good exmples of these are the little up-down arrows next to the number values on the screen. When you click the up arrow next to current salary, for example, the salary would go up by $1000, or something. With all this in mind, I have a few questions I have not been able to find the answer to yet. Question 1: Do I need anything more than the basic windows GDI to implement this? I have not been able to find out how to draw a background .bmp file to a window (or how to put it in full-screen for that matter) in GDI, so if anyone could enlighten me, I would very much appreciate it. Question 2: I was planning on just using a "hotspot" method for simulating the buttons (which currently are just part of the background .bmp). I know for a "real" game you would want a better implementation, but we are severely limited on time for this project and I want to make sure we can finish it. What I had planned was to keep track of the current screen in a variable, and then, when the program receives a mouse-clicked event, the function takes the position the mouse is clicked, as well as the current screen we are in, and tests it to see if it does anything or not. (basically a huge case-statement of some sort). Am I doing this the hard way, given my time frame (which, its due in about 2 more months). I would appreciate any help anyone can give me on this, especially on how to do the bmp files. I know directx can do it, but this seems like it would be somewhat of an overkill, since the screen doesn''t need to be updated 20-60 times per second, but only when the user clicks a button, or finishes a turn. Thanks, I hope someone can help. -Marc
On my homepage I have a section on drawing to a window and a basic windows app for download.

http://mazurek.dhs.org/3d/
Advertisement
I''m sorry, I don''t mean to seem rude. But I checked your page and it doesn''t seem to address any of the actual questions I brought up. Its a tutorial on 3d transformations and lighting for windows. With the exception of showing how to setup directx to draw 3d objects (which wasn''t my question anyway) it really doesn''t explain what I was asking.

Sorry.

So I''m still looking for input if anyone has any.
My 2 cents:
GDI can do this just fine. I think for what you want, you can just use tab controls, and override the paint method for your client area. Hot spots would be easy enough to implement just by tagging the x and y coordinates of the mouse down messages.

Have you decided on a compiler, already? For this kind of work, you could have your UI done in C++ Builder in about ten to twenty minutes. I believe a similar UI was presented in the book "C++ Builder Unleashed." It also comes with a demo version of C++ Builder if you don''t have a copy.

Otherwise I believe one of the tutorials on the MSDN website involves using a bitmap as the background for a window in VC++.

Alternately if you want to use VB, I believe VB forms you can just specify a background bitmap and let it handle it for you.

In other words, let us know at least what you''re compiling on, and I''m sure we can give you more specific help.
I apologize for my lack of info.

We are using vc++ 6.0 to compile the program in. The program is going to be for windows, but it doesn''t really matter what we do the graphics in (directx, gdi)...just as long as it works. The graphics are very simple (as shown), and only update when the user changes a value by pressing a button, or ending his turn and moving to the next turn.

I''ll check the msdn tutorials, if you have any additional information I would love to hear it.

This topic is closed to new replies.

Advertisement