Magic_Game/Easy2D/Node/ERectangle.cpp

25 lines
475 B
C++
Raw Normal View History

2017-10-14 18:43:32 +08:00
#include "..\enodes.h"
#include "..\Win\winbase.h"
2017-10-15 02:46:24 +08:00
e2d::ERectangle::ERectangle()
{
}
2017-10-17 21:22:25 +08:00
e2d::EColor e2d::ERectangle::getColor() const
2017-10-14 18:43:32 +08:00
{
2017-10-15 02:46:24 +08:00
return m_Color;
2017-10-14 18:43:32 +08:00
}
2017-10-17 21:22:25 +08:00
void e2d::ERectangle::setColor(EColor color)
2017-10-15 02:46:24 +08:00
{
m_Color = color;
}
void e2d::ERectangle::_onRender()
2017-10-14 18:43:32 +08:00
{
2017-10-17 21:22:25 +08:00
D2D1_RECT_F rectangle = D2D1::RectF(0, 0, getWidth(), getHeight());
2017-10-15 02:46:24 +08:00
GetSolidColorBrush()->SetColor(D2D1::ColorF(m_Color, m_fDisplayOpacity));
GetRenderTarget()->FillRectangle(&rectangle, GetSolidColorBrush());
2017-10-14 18:43:32 +08:00
}