Sign in to follow this  
LifeOfTamir

Creating a mini window within a window(solved)

Recommended Posts

Hi everyone, Okay here is the situation. I've got a landscape with lots of creatures running around. When the user clicks on a creature i want a new mini moveable window to pop up with lots of information about the creature and it's own viewport. Now i know how to create a viewport... but i don't know how to create a new window. Or to be more specific i don't know hwo to go about it...i don't know what techniques i should use or anythign so i don't know what i should be looking for for help. Advice would be grateful. [smile] --edit-- Apparantly rollercoaster tycoon and pokemon have something similar although having not played either i wouldn't know for sure [Edited by - LifeOfTamir on September 6, 2004 10:56:08 AM]

Share this post


Link to post
Share on other sites
In my opinion, this could get very complicated. You may have to design your own GUI that caters to multiple windows - you definetly don't want to try using Win32 windows for this. Check out the Developing a GUI Using C++ and DirectX series of articles.

Have you played around with the GUI that came with the Summer Update 2004 SDK? Specifically, check out the user interface in the PostProcess sample. If that is the type of thing that you are trying to get, then the SDK's GUI could be a very good option for you.

This is what I'm talking about:

Share this post


Link to post
Share on other sites
i tried to upgrade to the summer update but it caused me soo much trouble i basically had to redo my project from the start (don't ask)

i was hoping this wouldn't be complicated. Hmm...How much time do you think something like this could take? I'm kind of limited in that department.

I'll have to take a look at those articles in more detail tomorrow. i'm in no state for that now.

Share this post


Link to post
Share on other sites
Quote:
Original post by LifeOfTamir
i tried to upgrade to the summer update but it caused me soo much trouble i basically had to redo my project from the start (don't ask)


You could just use the 9.0c's sample framework GUI, and still compile with 9.0b. There may be some compiler errors, but it shouldn't be too bad.

Share this post


Link to post
Share on other sites
Okay forgive me but i'm going to dig this back out again.

I've had a look at those articles and the 9.0c sample (see other thread about unicode) and i've done some looking around on google (those articles by Mason McCuskey seem to appear *everywhere*).

Those articles really seem a bit too complex for what i need. I mean it's good if i was going for a full blown gui system that is flexible but all i really need is just to create a specific window that has one specific look that can be drawn. Am i still going to have to do somethign complicated or is there a shortcut...( i know i know shortcuts are bad ).

The 9.0c sample seemed most helpful cuz i can just include the class files they have created and use them...but i'm having problems and it might take me awhile to sort them out.

Share this post


Link to post
Share on other sites
Quote:
Original post by LifeOfTamir
The 9.0c sample seemed most helpful cuz i can just include the class files they have created and use them...but i'm having problems and it might take me awhile to sort them out.
What problems? I looked at the Unicode thread, and it appeared to be solved.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
Quote:
Original post by LifeOfTamir
The 9.0c sample seemed most helpful cuz i can just include the class files they have created and use them...but i'm having problems and it might take me awhile to sort them out.
What problems? I looked at the Unicode thread, and it appeared to be solved.


It's thrown up other problems within my original code... (obviously to do with strings and such like) I'm going through it all now but i don't know what all the correct ways to convert are so it's taking a bit of time. I also don't know if using UNICODE will affect other parts of my code because i don't know what the effect it has when i read in from an ASCII text file.

You've been a big help, i guess from here i just have to fix all these damn errors.

Share this post


Link to post
Share on other sites
I think you ask just how to manage the window, not how to actually render it?
Do you want your windows to just be property sheets ie display information only, or have input capabilities like buttons, textboxes etc. If the former you should be able to do it fairly easily. A fixed 'dialog' which is exactly the same layout everywhere could be hardcoded, or you could create a simple script a bit like HTML/CSS to let you be more flexible.

Share this post


Link to post
Share on other sites
Quote:
Original post by d000hg
I think you ask just how to manage the window, not how to actually render it?
Do you want your windows to just be property sheets ie display information only, or have input capabilities like buttons, textboxes etc. If the former you should be able to do it fairly easily. A fixed 'dialog' which is exactly the same layout everywhere could be hardcoded, or you could create a simple script a bit like HTML/CSS to let you be more flexible.


A property sheet is exactly what i want. The only 'button' i need would be a close button. I could hardcode it but the problem is i don't know how.

Share this post


Link to post
Share on other sites
If you want to keep it really simple, you could probably just use ID3DXSprite to render the information window and close button. Then, use ID3DXFont to draw text about the creature.

Maybe like this:



All it would really require would be a couple sprite calls (for the window itself, the close button, and the creature's image) and a bunch of font calls.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
If you want to keep it really simple, you could probably just use ID3DXSprite to render the information window and close button. Then, use ID3DXFont to draw text about the creature.

Maybe like this:
</image removed>

All it would really require would be a couple sprite calls (for the window itself, the close button, and the creature's image) and a bunch of font calls.


Something kind of like this had been in the back of my mind. I was reluctant to do it this way because i thought it might be cheating. But i think you are right. It would suit my needs far more than anything i am trying to do now. I've been wroking for hours and was probably furthur away from my goal than ever.

I thank you once again circlesoft you've been more than helpful.

Share this post


Link to post
Share on other sites
That does sound quite an easy way to do it. As a variation on this:
You could always just draw a pre-lit&trnsformed quad for the window, then draw another quad on top for the image of the character/item and another for the close box. Assuming you don't mind a rectangular window and a close button that doesn't 'move' when clicked you can do this with 3 quads which requires virtually no overhead in code terms. Then just draw the text on top with whatever you have - ID3DXFont or your own bitmapped font system. I think it'll be quicker than using sprites unless you already do - a bit less code to write is all.

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