Game menu GUI package

zhaozj2021-02-17  58

This gui is procourage (temporarily called "priority", interested in you can have changed more beautifully), I encapsulated the DirectDraw interface and encapsulated MIDI class and Menu class.

The method is as follows:

// The following code can be used once when the program is initialized

DirectDraw = New CDIRECTDRAW;

DirectDraw-> Create (hwnd) // Create a graphical interface

MIDI = New cmidi;

MIDI-> CREATE (HWND); // Create a MIDI Music Interface

Menu = new cmenu; // Create a menu class

===============================

// can be used after the creation, such as:

Midi-> Play ("filename.mid"); // Play FileName.mid music

Menu-> CreateMenu ("MainMenu", 0, 0, true); // Create a menu with "mainmenu.bmp"

Menu-> CreateButton ("NewGame", 284, 92); // Create a button on the background of "newgame.bmp" on the current menu

Menu-> CreateButton ("LoadGame", 284, 160); //> Digital represents x, y coordinate)

Menu-> CreateButton ("Gallery", 284, 249); //

Menu-> CreateButton ("Music", 284, 329); //

Menu-> CreateButton ("EXIT", 284, 410); //

Menu-> Delmenu (); // Delete menu

(Other functions, such as Click event, see the source code, have an annotation)

Note:

This example passes: VC6.0, DirectX 7.0 / 8.1 SDK, WIN2000 / WinXP

Finish

annex:

Description GUI.ZIP

转载请注明原文地址:https://www.9cbs.com/read-29717.html

New Post(0)