56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "EngineFrame/Component/Component.h"
|
|
#include "Tool/TransformT.h"
|
|
|
|
class RenderBase : public Component
|
|
{
|
|
|
|
public:
|
|
struct RenderGuidanceInfo
|
|
{
|
|
SDL_FRect rect;
|
|
// 旋转角度
|
|
float rotation;
|
|
// 翻转Flag
|
|
SDL_RendererFlip flip = SDL_FLIP_NONE;
|
|
// 锚点坐标
|
|
VecFPos AnchorPos;
|
|
// 是否显示
|
|
bool Visible = true;
|
|
// 是否在屏幕内
|
|
bool IsInScreen = false;
|
|
};
|
|
|
|
public:
|
|
RenderBase(/* args */);
|
|
~RenderBase();
|
|
|
|
public:
|
|
void Init() override;
|
|
|
|
void Update(float deltaTime) override;
|
|
void Render() override;
|
|
|
|
public:
|
|
public:
|
|
// 设置迭代的坐标
|
|
void SetIterationPos(VecFPos pos) override;
|
|
// 设置迭代的缩放
|
|
void SetIterationScale(VecFPos scale) override;
|
|
// 设置迭代的旋转角度
|
|
void SetIterationRotation(float angle) override;
|
|
|
|
// 设置坐标
|
|
void SetPos(VecFPos pos) override;
|
|
// 设置缩放
|
|
void SetScale(VecFPos scale) override;
|
|
// 设置旋转角度
|
|
void SetRotation(float angle) override;
|
|
// 设置中心点
|
|
void SetAnchor(VecFPos anchor) override;
|
|
|
|
// 计算渲染信息
|
|
void CalcRenderInfo() override;
|
|
};
|