www.pudn.com > Example2D.rar > CSprite.h


/////////////////////////////////////////////////////////////////////////////// 
// 
// CSprite.h 
// 
// Copyright (c) 2003 Forum Nokia.  All rights reserved. 
// 
// 	 Technology developed by Rocket Science Oy Ltd 
// 
/////////////////////////////////////////////////////////////////////////////// 
 
#ifndef __CSPRITE_H__ 
#define __CSPRITE_H__ 
 
// INCLUDE FILES 
#include  
 
// 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