csprite.h
来自「基于SYMBIAN OS,series 60平台的经典游戏,超级马力」· C头文件 代码 · 共 96 行
H
96 行
///////////////////////////////////////////////////////////////////////////////
//
// 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 <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 + =
减小字号Ctrl + -
显示快捷键?