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

📄 csprite.h

📁 Symbian OS S60平台2D游戏引擎案例
💻 H
字号:
   /*
============================================================================
    * Name : CSprite.h
    * Part of : 2DExample
    * Description : Definition of CSprite
    * Copyright (c) 2007 Nokia Corporation
============================================================================
    */

#ifndef __CSPRITE_H__
#define __CSPRITE_H__

// INCLUDE FILES
#include <e32base.h>

// FORWARD DECLARATIONS
class CBitmap;

// CLASS DECLARATION

/**
* CSprite class handles creation and drawing
* of bitmap images.
*/
class CSprite
	{
	public:

		/**
		* Two-phased constructor.
		*/
		static CSprite* NewL();

		/**
		* Destructor
		*/	
		~CSprite();

	private:
		
		/**
		* Default constructor
		*/	
		CSprite();

		/**
		* Second phase constructor
		*/
		void ConstructL();
		
	public:

		/**
		* Draws sprite to the given destination.
		* @param aTarget Target bitmap.
		* @param aIndex MBM index number.
		* @param aCamera Current camera position.
		*/
		void Draw( CBitmap& aTarget, TInt aIndex, const TPoint& aCamera );

		/**
		* Set the position of sprite
		* @param aPosition Sprite position.
		*/	
		void SetPosition( const TPoint& aPosition );

		/**
		* Add the bitmap image of sprite
		* @param aBitmap Sprite bitmap.
		*/	
		void AddSpriteBmp( CBitmap* aBitmap );

		/**
		* Returns the position of sprite.
		* @return TPoint Sprite position.
		*/
		TPoint Position();

		/**
		* Returns the bitmap of sprite.
		* @return CBitmap* Sprite bitmap.
		*/
		CBitmap* Bitmap();
		
	private: // Data members

		TPoint iPosition;					/// sprite position
		RPointerArray< CBitmap >iBitmaps;	/// sprite bitmaps

	};

#endif

// End of file

⌨️ 快捷键说明

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