feat(canvas): add DrawActor

This commit is contained in:
Nomango 2023-09-24 16:10:55 +08:00
parent 185a256223
commit 41f726b489
1 changed files with 14 additions and 0 deletions

View File

@ -86,6 +86,11 @@ public:
/// @brief ½áÊøäÖȾ /// @brief ½áÊøäÖȾ
void EndDraw(); void EndDraw();
/// \~chinese
/// @brief »­½ÇÉ«
/// @param actor ½ÇÉ«
void DrawActor(ActorPtr actor);
/// \~chinese /// \~chinese
/// @brief »­ÐÎ×´ÂÖÀª /// @brief »­ÐÎ×´ÂÖÀª
/// @param shape ÐÎ×´ /// @param shape ÐÎ×´
@ -302,6 +307,15 @@ inline void CanvasRenderContext::EndDraw()
ctx_->EndDraw(); ctx_->EndDraw();
} }
inline void CanvasRenderContext::DrawActor(ActorPtr actor)
{
KGE_ASSERT(ctx_);
if (actor)
{
actor->OnRender(*ctx_);
}
}
inline void CanvasRenderContext::DrawShape(ShapePtr shape) inline void CanvasRenderContext::DrawShape(ShapePtr shape)
{ {
KGE_ASSERT(ctx_); KGE_ASSERT(ctx_);