73 lines
1.4 KiB
C++
73 lines
1.4 KiB
C++
#pragma once
|
|
#include <kiwano/kiwano.h>
|
|
using namespace kiwano;
|
|
//#include "kiwano/render/DirectX/NativePtr.h"
|
|
|
|
KGE_DECLARE_SMART_PTR(SpriteEx);
|
|
|
|
class SpriteEx : public Sprite
|
|
{
|
|
private:
|
|
//D2D1_INTERPOLATION_MODE INTERPOLATION_MODE = D2D1_INTERPOLATION_MODE_FORCE_DWORD;
|
|
//D2D1_COMPOSITE_MODE COMPOSITE_MODE = D2D1_COMPOSITE_MODE_FORCE_DWORD;
|
|
int MyModel = -1;
|
|
std::string TexturePtrName;
|
|
//阴影对象
|
|
SpriteExPtr ShadowObject = nullptr;
|
|
|
|
//播放动画的时间
|
|
int OffsetTime = 0;
|
|
//延迟集合
|
|
std::vector<int> MyDelay;
|
|
//是否是播放动画
|
|
bool is_Animotion_Play = false;
|
|
//当前帧数
|
|
int NowFrameIndex = 0;
|
|
//总帧数
|
|
int MaxFrameCount = 0;
|
|
//是否循环播放
|
|
int MyLoop = -1;
|
|
|
|
|
|
public:
|
|
SpriteEx()
|
|
{
|
|
|
|
}
|
|
|
|
SpriteEx(TexturePtr texture)
|
|
{
|
|
SetFrame(SpriteFrame(texture));
|
|
}
|
|
|
|
SpriteEx(const std::string Path)
|
|
{
|
|
Load(Path);
|
|
}
|
|
|
|
SpriteEx(const std::string imgpath, const int frame);
|
|
|
|
//带有NPK坐标变化的设置坐标
|
|
void SetPosition(const Point& point)override;
|
|
|
|
//要改变阴影朝向
|
|
void SetScale(const Point& point)override;
|
|
|
|
void OnRender(RenderContext& ctx) override;
|
|
|
|
void SetMode(int Type) {
|
|
MyModel = Type;
|
|
}
|
|
|
|
//void OnUpdate(Duration dt) override;
|
|
|
|
void SetFrameInfo(std::vector<int> FrameDaley,const int Loop);
|
|
|
|
void SetAnimotionPlay(bool Type);
|
|
|
|
void SetAnimotionFrame(const int gFrame);
|
|
|
|
void SetShadow();
|
|
};
|
|
|