⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appstatemenu.h

📁 RGA: Biowaste Game Example This C++ application demonstrates how to create a 2D mobile game for S60
💻 H
字号:
/*
* ==============================================================================
*  Name        : AppStateMenu.h
*  Part of     : RGA Game Example
*  Interface   :
*  Description : application main menu state
*  Version     : 1.0
*
*  Copyright (c) 2007-2008 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ==============================================================================
*/

#ifndef __APPSTATEMENU_H__
#define __APPSTATEMENU_H__

#include "GameMenu.h"
#include "Vector2.h"



class CAppStateMenu : public CAppState
	{
	public:
		CAppStateMenu(CExampleApplication& aApp);
		virtual ~CAppStateMenu();

		/**
		 * Init
		 * Initialise the state
		 * @return KErrNone if successfull
		 */
		virtual TInt Init();
		
		/**
		 * Update
		 * Update application state
		 * @param aFrametime seconds elapsed since last frame
		 * @return state change value
		 */
		virtual EAppUpdateState Update(const TReal64& aFrametime);
		
		/**
		 * Draw
		 * Draw state graphics to given graphics context
		 * @param aContext graphics context to draw to.
		 */
		virtual void Draw(IGraphicsContext& aContext);
		
		/**
		 * KeyDown
		 * This handler is called by the main application object
		 * when any key is pressed
		 * @param aKeyCode RGA input key code of the pressed key
		 */
		virtual void KeyDown(TUint32 aKeyCode);
		
		/**
		 * DisplayOrientationChanged
		 * This handler is called by the application object
		 * when display orientation changes (portrait-landscape)
		 */
		virtual void DisplayOrientationChanged();
		
		/**
		 * OpenHighScoresTable
		 * set menu to high scores table
		 * @param aHighlightIndex index in highscores to highlight, or -1
		 */
		void OpenHighScoresTable(TInt aHighlightIndex);
		
		
	private:	// new functions
		/**
		 * LoadBackground
		 * load background image
		 * @return KErrNone or an error code
		 */
		TInt LoadBackground();
		
		/**
		 * InitMenu
		 * initialise menu items
		 * @return KErrNone or an error code
		 */
		TInt InitMenu();
		
		/**
		 * InitMenuPos
		 * initialise menu items position to outside of screen
		 */
		void InitMenuPos();
		
		/**
		 * DrawHighScores
		 * Draw high scores table to back buffer
		 */
		void DrawHighScores();
	
	
	private:	// data
		EAppUpdateState			iNextState;
		
		CGameMenu*				iMenu;
		IBitmap*				iBknd;

		TVector2				iMenuPos;
		TVector2				iMenuWantTo;
		
		TInt					iMenuState;
		TInt					iHighScoreHighlight;
		
		CAppState*				iExtraScreen;
	};

#endif /* __APPSTATEMENU_H__*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -