Update ShapeActor
This commit is contained in:
parent
50d2b80d79
commit
8c291b1cdc
|
|
@ -24,9 +24,36 @@
|
||||||
|
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
ShapeActorPtr ShapeActor::Create()
|
|
||||||
|
ShapeActorPtr ShapeActor::Create(ShapePtr shape)
|
||||||
{
|
{
|
||||||
ShapeActorPtr ptr = new (std::nothrow) ShapeActor;
|
ShapeActorPtr ptr = new (std::nothrow) ShapeActor;
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
|
ptr->SetShape(shape);
|
||||||
|
}
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapeActorPtr ShapeActor::Create(ShapePtr shape, const Color& fill_color, const Color& stroke_color)
|
||||||
|
{
|
||||||
|
ShapeActorPtr ptr = ShapeActor::Create(shape);
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
|
ptr->SetFillColor(fill_color);
|
||||||
|
ptr->SetStrokeColor(stroke_color);
|
||||||
|
}
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapeActorPtr ShapeActor::Create(ShapePtr shape, BrushPtr fill_brush, BrushPtr stroke_brush)
|
||||||
|
{
|
||||||
|
ShapeActorPtr ptr = ShapeActor::Create(shape);
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
|
ptr->SetFillBrush(fill_brush);
|
||||||
|
ptr->SetStrokeBrush(stroke_brush);
|
||||||
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,22 @@ class KGE_API ShapeActor : public Actor
|
||||||
public:
|
public:
|
||||||
/// \~chinese
|
/// \~chinese
|
||||||
/// @brief 创建形状角色
|
/// @brief 创建形状角色
|
||||||
static ShapeActorPtr Create();
|
/// @param shape 形状
|
||||||
|
static ShapeActorPtr Create(ShapePtr shape);
|
||||||
|
|
||||||
|
/// \~chinese
|
||||||
|
/// @brief 创建形状角色
|
||||||
|
/// @param shape 形状
|
||||||
|
/// @param fill_color 填充颜色
|
||||||
|
/// @param stroke_color 轮廓颜色
|
||||||
|
static ShapeActorPtr Create(ShapePtr shape, const Color& fill_color, const Color& stroke_color);
|
||||||
|
|
||||||
|
/// \~chinese
|
||||||
|
/// @brief 创建形状角色
|
||||||
|
/// @param shape 形状
|
||||||
|
/// @param fill_brush 填充画刷
|
||||||
|
/// @param stroke_brush 轮廓画刷
|
||||||
|
static ShapeActorPtr Create(ShapePtr shape, BrushPtr fill_brush, BrushPtr stroke_brush);
|
||||||
|
|
||||||
/// \~chinese
|
/// \~chinese
|
||||||
/// @brief 构造形状角色
|
/// @brief 构造形状角色
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue