📄 mainmenu.h
字号:
/**
* File : MainMenu.h
* Author : Kevin Lynx
* Date : 2007/8/3
*/
#ifndef _MAIN_MENU_H_
#define _MAIN_MENU_H_
#include "Singleton.h"
/**
* MainMenu
*
* Implements the main menu in the game
*/
class MainMenu : public Singleton<MainMenu>
{
public:
/**
* gui controls id
*
*/
enum
{
BTN_START_ID = 1,
BTN_HELP_ID,
BTN_CREDITS_ID,
BTN_EXIT_ID,
BTN_HELP_BACK_ID,
BTN_CREDITS_BACK_ID
};
enum
{
TV_TEX_COUNT = 3,
TVNOISE_TEX_COUNT = 3,
TV_CHANGE_TIME = 3000,
TVNOISE_CHANGE_TIME = 100,
};
enum
{
MENU_STATE_MAIN,
MENU_STATE_HELP,
MENU_STATE_CREDITS
};
public:
/**
* Constructor
*
*/
MainMenu( IrrlichtDevice *device );
/**
* Destructor
*
*/
~MainMenu();
/**
* init
*
* it will create all the gui elements
*/
bool init();
/**
* update
*
*/
void update( float dt );
/**
* render
*
*/
void render();
/**
* enter
*
* when enter the main menu , call this function
*/
void enter();
/**
* OnEvent
*
*/
bool OnEvent( SEvent event );
private:
void setButtonPro( IGUIButton *button );
void changeState( int state );
private:
IrrlichtDevice *mDevice;
ITexture *mTV[TV_TEX_COUNT];
int mCurTV;
u32 mTVLastTime;
ITexture *mTVNoise[TVNOISE_TEX_COUNT];
int mCurTVNoise;
u32 mTVNoiseLastTime;
int mState;
};
#endif //end _MAIN_MENU_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -