Files
DNF_DEV/source/EngineFrame/Base/Actor.h
2026-02-08 16:20:50 +08:00

38 lines
952 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "EngineFrame/Base/Node.h"
#include "Tool/IntrusiveList.hpp"
class Scene;
/**
* @brief Actor类继承自Actor_base类
*
* Actor类是一个基础的游戏对象类可以添加到场景中
*/
class Actor : public Node
{
protected:
/**裁切视口Flag */
bool _CropViewportFlag = false;
/**裁切视口 */
SDL_Rect _CropViewport = {0, 0, 0, 0};
/**混合模式 */
LE_BlEND_MODE _BlendMode = NONE;
public:
// 初始化
virtual void Init();
// 被添加时
virtual void OnAdded(Actor *node);
// 设置混合模式
void SetBlendMode(LE_BlEND_MODE mode);
// 获取混合模式
LE_BlEND_MODE GetBlendMode();
public:
/**重载渲染函数 */
void Render() override;
/**设置裁切视口(放在Actor里 他与他的子对象都会被裁切) */
void SetCropViewport(SDL_Rect CropViewport);
/**获取裁切视口 */
SDL_Rect GetCropViewport();
};