📄 tiledlayer.h
字号:
#ifndef _H_CTILEDLAYER_
#define _H_CTILEDLAYER_
#include <e32std.h>
#include <e32base.h>
#include "Layer.h"
namespace gamespace
{
/************************************************************************/
/* 保存内容为帧索引的序列,画序列中的所有的帧,贴图帧索引from 1,0表示空,透明*/
/************************************************************************/
class CTiledLayer : public CLayer
{
private:
TInt iSceneRows;//场景的行,列数
TInt iSceneCols;
TInt* iPSequence;//场景序列,序列中保存帧索引
private:
void Init();
CTiledLayer();
void ConstructL(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,int aCellWidth,int aCellHeight);
public:
~CTiledLayer();
static CTiledLayer* NewL(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,int aCellWidth=0,int aCellHeight=0);
static CTiledLayer* NewLC(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,int aCellWidth=0,int aCellHeight=0);
virtual void SetRange(TInt sceneRows,TInt sceneCols,TInt frameIndex=0);//设置场景的行数,列数,和默认帧索引
void SetCell(TInt row,TInt col,TInt frameIndex);//row,col从0开始,设置某个cell的值为frameIndex
TInt Cell(TInt row,TInt col);//row,col从0开始,得到某个cell的frameIndex值
void FillCells(TInt beginrow,TInt begincol,TInt endrow,TInt endcol,TInt frameIndex);//设置连续的一组cell都为frameIndex
void SetScence(TInt* pSequence,TInt sceneRows,TInt sceneCols );//传入序列
TInt SceneRows();
TInt SceneCols();
void Draw(CBitmapContext& aGc);
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -