Option Screen help need

Started by
2 comments, last by Link 20 years, 6 months ago
I would make an option screen or a start game screen in Direct3D (9.0). It is a simple bitmap of background and 2 buttons START GAME and EXIT. How can i make these two buttons so i can handle them by the mouse? P.s. The game is FullScreen
Advertisement
a quick and easy way to do it is just to draw the buttons onto the bitmap, and check if mouse clicks are within a box that surrounds the two options.

or you could work out a real GUI, or use a 3rd party one from somewhere...
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
can u give me an example?
Just take the time and implement your own version of menu system so that you can change it easily later.

The principle behind drawing 2D menu over 3d engine in the background is to create rectangles (2 triangles) with the texture of the menu with RHW component (RHW=1)

		// Custom FVF, which describes our Menu rectangle vertex structurestruct MENURECTANGLECUSTOMVERTEX{FLOAT x, y, z, rhw;      // The position for the vertexD3DCOLOR color;        // The vertex colorFLOAT tu,tv;       // Tex.coordinate};#define D3DFVF_MENURECTANGLECUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)


The coordinates for triangles are normal screen coordinates (0,0 ->1024x768), for every vertex, RHW=1.0f and z=0.0f and that`s it. You render it normally through VB as any other 3d object and you have a nice 2D menu over the 3d engine in the background.

Then just take the current mouse position and compare it if it is in the range of the menu and check pressing of mouse buttons and you`re done.

VladR
Avenger 3D game

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

This topic is closed to new replies.

Advertisement