Magic_Game/Easy2D/Node/Shape/Shape.cpp

57 lines
739 B
C++
Raw Normal View History

2017-09-10 23:56:52 +08:00
#include "..\..\Easy2d.h"
#include "..\..\EasyX\easyx.h"
Shape::Shape()
{
}
Shape::~Shape()
{
}
void Shape::_onDraw()
{
// <20><>״<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ
if (!m_bDisplay)
{
return;
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
setlinecolor(lineColor);
setfillcolor(fillColor);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD><D7B4><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>в<EFBFBD>ͬ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>
if (_style == Shape::STYLE::round)
{
roundShape();
}
else if (_style == Shape::STYLE::solid)
{
solidShape();
}
else if (_style == Shape::STYLE::fill)
{
fillShape();
}
}
inline COLORREF Shape::getFillColor() const
{
return fillColor;
}
inline COLORREF Shape::getLineColor() const
{
return lineColor;
}
void Shape::setFillColor(COLORREF color)
{
fillColor = color;
}
void Shape::setLineColor(COLORREF color)
{
lineColor = color;
}