Sign in to follow this  
Jouei

DirectDraw Buttons ?

Recommended Posts

Hi makeing a game interface for the main menu and i was just woundering how one would go about doing some buttons i think im down to doing Win32 owner drawen buttons but i havent done those before and id like to stay away from the slow graphics of windows! any recomendations or tutorials or so on and so forth would be helpful thanks alot ahead of time as usal appologize for my poor grammer

Share this post


Link to post
Share on other sites
well, i think there are several ways to approach this.

Mine was to create a class called 'tdxmenu' and there i've got my button-objects stored. my buttons consist of a hovered bitmap, a normal bitmap and a clicked bitmap, and several other stuff (like offsets). the trick is to see buttons as graphics, and you can display bitmaps under directx.
then you just need to get the 'hovered' and 'clicked' states, so you need a routine that can see if the mouse pointer is inside the rectangle or whatever of the button.
and so your menu can return a value for the pressed button.

well, that was quite short, but i think it's a better approach than using windows gdi-things :-)

Share this post


Link to post
Share on other sites
Well thats basicaly what i got but it just dosent seem to work right i guess im boaching it on the way im writing a function to check if its pressed i can get that fine its doing the stages is for the most part id like to get it so when the user lifts the mouse button from that control it does a call to a function or so on, and im having the minor problem of when you drag the mouse with the button still clicked it presses down the other buttons as well since i have a slight delay in the down graphic so at least the user can see the button graphic of it being pressed!

hopefuly i worded that all alright!

a small example may help if you have the time!

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