rename DebugNode to DebugActor && rename ShapeNode to ShapeActor
This commit is contained in:
parent
ed034750fe
commit
ab9ffb5e79
|
|
@ -27,10 +27,10 @@
|
||||||
<ClInclude Include="..\src\kiwano\2d\include-forwards.h" />
|
<ClInclude Include="..\src\kiwano\2d\include-forwards.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Canvas.h" />
|
<ClInclude Include="..\src\kiwano\2d\Canvas.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Color.h" />
|
<ClInclude Include="..\src\kiwano\2d\Color.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\DebugNode.h" />
|
<ClInclude Include="..\src\kiwano\2d\DebugActor.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Font.hpp" />
|
<ClInclude Include="..\src\kiwano\2d\Font.hpp" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\FrameSequence.h" />
|
<ClInclude Include="..\src\kiwano\2d\FrameSequence.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\ShapeNode.h" />
|
<ClInclude Include="..\src\kiwano\2d\ShapeActor.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Layer.h" />
|
<ClInclude Include="..\src\kiwano\2d\Layer.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Actor.h" />
|
<ClInclude Include="..\src\kiwano\2d\Actor.h" />
|
||||||
<ClInclude Include="..\src\kiwano\2d\Stage.h" />
|
<ClInclude Include="..\src\kiwano\2d\Stage.h" />
|
||||||
|
|
@ -92,10 +92,10 @@
|
||||||
<ClCompile Include="..\src\kiwano\2d\action\Animation.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\action\Animation.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\Canvas.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\Canvas.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\Color.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\Color.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\DebugNode.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\DebugActor.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\Frame.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\Frame.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\FrameSequence.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\FrameSequence.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\ShapeNode.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\ShapeActor.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\GifSprite.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\GifSprite.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\Layer.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\Layer.cpp" />
|
||||||
<ClCompile Include="..\src\kiwano\2d\Actor.cpp" />
|
<ClCompile Include="..\src\kiwano\2d\Actor.cpp" />
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,6 @@
|
||||||
<ClInclude Include="..\src\kiwano\2d\Color.h">
|
<ClInclude Include="..\src\kiwano\2d\Color.h">
|
||||||
<Filter>2d</Filter>
|
<Filter>2d</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\src\kiwano\2d\DebugNode.h">
|
|
||||||
<Filter>2d</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\src\kiwano\2d\Font.hpp">
|
<ClInclude Include="..\src\kiwano\2d\Font.hpp">
|
||||||
<Filter>2d</Filter>
|
<Filter>2d</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
@ -201,9 +198,6 @@
|
||||||
<ClInclude Include="..\src\kiwano\third-party\tinyxml2\tinyxml2.h">
|
<ClInclude Include="..\src\kiwano\third-party\tinyxml2\tinyxml2.h">
|
||||||
<Filter>third-party\tinyxml2</Filter>
|
<Filter>third-party\tinyxml2</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\src\kiwano\2d\ShapeNode.h">
|
|
||||||
<Filter>2d</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\src\kiwano\base\Director.h">
|
<ClInclude Include="..\src\kiwano\base\Director.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
@ -279,6 +273,12 @@
|
||||||
<ClInclude Include="..\src\kiwano\core\core.h">
|
<ClInclude Include="..\src\kiwano\core\core.h">
|
||||||
<Filter>core</Filter>
|
<Filter>core</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\src\kiwano\2d\DebugActor.h">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\src\kiwano\2d\ShapeActor.h">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\src\kiwano\ui\Button.cpp">
|
<ClCompile Include="..\src\kiwano\ui\Button.cpp">
|
||||||
|
|
@ -293,9 +293,6 @@
|
||||||
<ClCompile Include="..\src\kiwano\2d\Color.cpp">
|
<ClCompile Include="..\src\kiwano\2d\Color.cpp">
|
||||||
<Filter>2d</Filter>
|
<Filter>2d</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\kiwano\2d\DebugNode.cpp">
|
|
||||||
<Filter>2d</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\src\kiwano\2d\Layer.cpp">
|
<ClCompile Include="..\src\kiwano\2d\Layer.cpp">
|
||||||
<Filter>2d</Filter>
|
<Filter>2d</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -380,9 +377,6 @@
|
||||||
<ClCompile Include="..\src\kiwano\third-party\tinyxml2\tinyxml2.cpp">
|
<ClCompile Include="..\src\kiwano\third-party\tinyxml2\tinyxml2.cpp">
|
||||||
<Filter>third-party\tinyxml2</Filter>
|
<Filter>third-party\tinyxml2</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\kiwano\2d\ShapeNode.cpp">
|
|
||||||
<Filter>2d</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\src\kiwano\base\Director.cpp">
|
<ClCompile Include="..\src\kiwano\base\Director.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -425,5 +419,11 @@
|
||||||
<ClCompile Include="..\src\kiwano\2d\FrameSequence.cpp">
|
<ClCompile Include="..\src\kiwano\2d\FrameSequence.cpp">
|
||||||
<Filter>2d</Filter>
|
<Filter>2d</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\kiwano\2d\DebugActor.cpp">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\kiwano\2d\ShapeActor.cpp">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#include "DebugNode.h"
|
#include "DebugActor.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "../renderer/render.h"
|
#include "../renderer/render.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -18,12 +18,12 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#include "ShapeNode.h"
|
#include "ShapeActor.h"
|
||||||
#include "../base/logs.h"
|
#include "../base/logs.h"
|
||||||
|
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
ShapeNode::ShapeNode()
|
ShapeActor::ShapeActor()
|
||||||
: fill_color_(Color::White)
|
: fill_color_(Color::White)
|
||||||
, stroke_color_(Color(Color::Black, 0))
|
, stroke_color_(Color(Color::Black, 0))
|
||||||
, stroke_width_(1.f)
|
, stroke_width_(1.f)
|
||||||
|
|
@ -31,17 +31,17 @@ namespace kiwano
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ShapeNode::ShapeNode(ComPtr<ID2D1Geometry> geometry)
|
ShapeActor::ShapeActor(ComPtr<ID2D1Geometry> geometry)
|
||||||
: ShapeNode()
|
: ShapeActor()
|
||||||
{
|
{
|
||||||
SetGeometry(geometry);
|
SetGeometry(geometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShapeNode::~ShapeNode()
|
ShapeActor::~ShapeActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect ShapeNode::GetBoundingBox()
|
Rect ShapeActor::GetBoundingBox()
|
||||||
{
|
{
|
||||||
if (!geo_)
|
if (!geo_)
|
||||||
return Rect{};
|
return Rect{};
|
||||||
|
|
@ -52,7 +52,7 @@ namespace kiwano
|
||||||
return Rect{ rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top };
|
return Rect{ rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top };
|
||||||
}
|
}
|
||||||
|
|
||||||
float ShapeNode::GetLength()
|
float ShapeActor::GetLength()
|
||||||
{
|
{
|
||||||
float length = 0.f;
|
float length = 0.f;
|
||||||
if (geo_)
|
if (geo_)
|
||||||
|
|
@ -63,7 +63,7 @@ namespace kiwano
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShapeNode::ComputePointAtLength(float length, Point& point, Vec2& tangent)
|
bool ShapeActor::ComputePointAtLength(float length, Point& point, Vec2& tangent)
|
||||||
{
|
{
|
||||||
if (geo_)
|
if (geo_)
|
||||||
{
|
{
|
||||||
|
|
@ -79,7 +79,7 @@ namespace kiwano
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float ShapeNode::ComputeArea()
|
float ShapeActor::ComputeArea()
|
||||||
{
|
{
|
||||||
if (!geo_)
|
if (!geo_)
|
||||||
return 0.f;
|
return 0.f;
|
||||||
|
|
@ -90,7 +90,7 @@ namespace kiwano
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShapeNode::ContainsPoint(Point const& point)
|
bool ShapeActor::ContainsPoint(Point const& point)
|
||||||
{
|
{
|
||||||
if (!geo_)
|
if (!geo_)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -105,27 +105,27 @@ namespace kiwano
|
||||||
return !!ret;
|
return !!ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeNode::SetFillColor(const Color & color)
|
void ShapeActor::SetFillColor(const Color & color)
|
||||||
{
|
{
|
||||||
fill_color_ = color;
|
fill_color_ = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeNode::SetStrokeColor(const Color & color)
|
void ShapeActor::SetStrokeColor(const Color & color)
|
||||||
{
|
{
|
||||||
stroke_color_ = color;
|
stroke_color_ = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeNode::SetStrokeWidth(float width)
|
void ShapeActor::SetStrokeWidth(float width)
|
||||||
{
|
{
|
||||||
stroke_width_ = std::max(width, 0.f);
|
stroke_width_ = std::max(width, 0.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeNode::SetOutlineJoinStyle(StrokeStyle outline_join)
|
void ShapeActor::SetOutlineJoinStyle(StrokeStyle outline_join)
|
||||||
{
|
{
|
||||||
outline_join_ = outline_join;
|
outline_join_ = outline_join;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeNode::OnRender()
|
void ShapeActor::OnRender()
|
||||||
{
|
{
|
||||||
if (geo_)
|
if (geo_)
|
||||||
{
|
{
|
||||||
|
|
@ -144,23 +144,23 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// LineNode
|
// LineActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
LineNode::LineNode()
|
LineActor::LineActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LineNode::LineNode(Point const& begin, Point const& end)
|
LineActor::LineActor(Point const& begin, Point const& end)
|
||||||
{
|
{
|
||||||
SetLine(begin, end);
|
SetLine(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
LineNode::~LineNode()
|
LineActor::~LineActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineNode::SetLine(Point const& begin, Point const& end)
|
void LineActor::SetLine(Point const& begin, Point const& end)
|
||||||
{
|
{
|
||||||
ComPtr<ID2D1PathGeometry> path_geo;
|
ComPtr<ID2D1PathGeometry> path_geo;
|
||||||
ComPtr<ID2D1GeometrySink> path_sink;
|
ComPtr<ID2D1GeometrySink> path_sink;
|
||||||
|
|
@ -186,40 +186,40 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineNode::SetBegin(Point const& begin)
|
void LineActor::SetBegin(Point const& begin)
|
||||||
{
|
{
|
||||||
SetLine(begin, end_);
|
SetLine(begin, end_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineNode::SetEnd(Point const& end)
|
void LineActor::SetEnd(Point const& end)
|
||||||
{
|
{
|
||||||
SetLine(begin_, end);
|
SetLine(begin_, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// RectNode
|
// RectActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
RectNode::RectNode()
|
RectActor::RectActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RectNode::RectNode(Rect const& rect)
|
RectActor::RectActor(Rect const& rect)
|
||||||
{
|
{
|
||||||
SetRect(rect);
|
SetRect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
RectNode::RectNode(Point const& left_top, Size const& size)
|
RectActor::RectActor(Point const& left_top, Size const& size)
|
||||||
{
|
{
|
||||||
SetRect(Rect{ left_top, size });
|
SetRect(Rect{ left_top, size });
|
||||||
}
|
}
|
||||||
|
|
||||||
RectNode::~RectNode()
|
RectActor::~RectActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RectNode::SetRect(Rect const& rect)
|
void RectActor::SetRect(Rect const& rect)
|
||||||
{
|
{
|
||||||
ComPtr<ID2D1RectangleGeometry> geo;
|
ComPtr<ID2D1RectangleGeometry> geo;
|
||||||
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
||||||
|
|
@ -233,35 +233,35 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// RoundedRectNode
|
// RoundRectActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
RoundedRectNode::RoundedRectNode()
|
RoundRectActor::RoundRectActor()
|
||||||
: radius_x_(0.f)
|
: radius_x_(0.f)
|
||||||
, radius_y_(0.f)
|
, radius_y_(0.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RoundedRectNode::RoundedRectNode(Rect const& rect, float radius_x, float radius_y)
|
RoundRectActor::RoundRectActor(Rect const& rect, float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
SetRoundedRect(rect, radius_x, radius_y);
|
SetRoundedRect(rect, radius_x, radius_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
RoundedRectNode::~RoundedRectNode()
|
RoundRectActor::~RoundRectActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundedRectNode::SetRadius(float radius_x, float radius_y)
|
void RoundRectActor::SetRadius(float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
SetRoundedRect(rect_, radius_x, radius_y);
|
SetRoundedRect(rect_, radius_x, radius_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundedRectNode::SetRect(Rect const& rect)
|
void RoundRectActor::SetRect(Rect const& rect)
|
||||||
{
|
{
|
||||||
SetRoundedRect(rect, radius_x_, radius_y_);
|
SetRoundedRect(rect, radius_x_, radius_y_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundedRectNode::SetRoundedRect(Rect const& rect, float radius_x, float radius_y)
|
void RoundRectActor::SetRoundedRect(Rect const& rect, float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
ComPtr<ID2D1RoundedRectangleGeometry> geo;
|
ComPtr<ID2D1RoundedRectangleGeometry> geo;
|
||||||
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
||||||
|
|
@ -283,34 +283,34 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// CircleNode
|
// CircleActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
CircleNode::CircleNode()
|
CircleActor::CircleActor()
|
||||||
: radius_(0.f)
|
: radius_(0.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CircleNode::CircleNode(Point const& center, float radius)
|
CircleActor::CircleActor(Point const& center, float radius)
|
||||||
{
|
{
|
||||||
SetCircle(center, radius);
|
SetCircle(center, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
CircleNode::~CircleNode()
|
CircleActor::~CircleActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CircleNode::SetRadius(float radius)
|
void CircleActor::SetRadius(float radius)
|
||||||
{
|
{
|
||||||
SetCircle(center_, radius);
|
SetCircle(center_, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CircleNode::SetCenter(Point const& center)
|
void CircleActor::SetCenter(Point const& center)
|
||||||
{
|
{
|
||||||
SetCircle(center, radius_);
|
SetCircle(center, radius_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CircleNode::SetCircle(Point const& center, float radius)
|
void CircleActor::SetCircle(Point const& center, float radius)
|
||||||
{
|
{
|
||||||
ComPtr<ID2D1EllipseGeometry> geo;
|
ComPtr<ID2D1EllipseGeometry> geo;
|
||||||
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
||||||
|
|
@ -330,35 +330,35 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// EllipseNode
|
// EllipseActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
EllipseNode::EllipseNode()
|
EllipseActor::EllipseActor()
|
||||||
: radius_x_(0.f)
|
: radius_x_(0.f)
|
||||||
, radius_y_(0.f)
|
, radius_y_(0.f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EllipseNode::EllipseNode(Point const& center, float radius_x, float radius_y)
|
EllipseActor::EllipseActor(Point const& center, float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
SetEllipse(center, radius_x, radius_y);
|
SetEllipse(center, radius_x, radius_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
EllipseNode::~EllipseNode()
|
EllipseActor::~EllipseActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void EllipseNode::SetRadius(float radius_x, float radius_y)
|
void EllipseActor::SetRadius(float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
SetEllipse(center_, radius_x, radius_y);
|
SetEllipse(center_, radius_x, radius_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EllipseNode::SetCenter(Point const& center)
|
void EllipseActor::SetCenter(Point const& center)
|
||||||
{
|
{
|
||||||
SetEllipse(center, radius_x_, radius_y_);
|
SetEllipse(center, radius_x_, radius_y_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EllipseNode::SetEllipse(Point const& center, float radius_x, float radius_y)
|
void EllipseActor::SetEllipse(Point const& center, float radius_x, float radius_y)
|
||||||
{
|
{
|
||||||
ComPtr<ID2D1EllipseGeometry> geo;
|
ComPtr<ID2D1EllipseGeometry> geo;
|
||||||
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
auto factory = Renderer::GetInstance()->GetD2DDeviceResources()->GetFactory();
|
||||||
|
|
@ -378,18 +378,18 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// PathNode
|
// PathActor
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
PathNode::PathNode()
|
PathActor::PathActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PathNode::~PathNode()
|
PathActor::~PathActor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::BeginPath(Point const& begin_pos)
|
void PathActor::BeginPath(Point const& begin_pos)
|
||||||
{
|
{
|
||||||
current_geometry_ = nullptr;
|
current_geometry_ = nullptr;
|
||||||
|
|
||||||
|
|
@ -406,7 +406,7 @@ namespace kiwano
|
||||||
current_sink_->BeginFigure(DX::ConvertToPoint2F(begin_pos), D2D1_FIGURE_BEGIN_FILLED);
|
current_sink_->BeginFigure(DX::ConvertToPoint2F(begin_pos), D2D1_FIGURE_BEGIN_FILLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::EndPath(bool closed)
|
void PathActor::EndPath(bool closed)
|
||||||
{
|
{
|
||||||
if (current_sink_)
|
if (current_sink_)
|
||||||
{
|
{
|
||||||
|
|
@ -422,13 +422,13 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::AddLine(Point const& point)
|
void PathActor::AddLine(Point const& point)
|
||||||
{
|
{
|
||||||
if (current_sink_)
|
if (current_sink_)
|
||||||
current_sink_->AddLine(DX::ConvertToPoint2F(point));
|
current_sink_->AddLine(DX::ConvertToPoint2F(point));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::AddLines(Vector<Point> const& points)
|
void PathActor::AddLines(Vector<Point> const& points)
|
||||||
{
|
{
|
||||||
if (current_sink_ && !points.empty())
|
if (current_sink_ && !points.empty())
|
||||||
{
|
{
|
||||||
|
|
@ -439,7 +439,7 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::AddBezier(Point const& point1, Point const& point2, Point const& point3)
|
void PathActor::AddBezier(Point const& point1, Point const& point2, Point const& point3)
|
||||||
{
|
{
|
||||||
if (current_sink_)
|
if (current_sink_)
|
||||||
{
|
{
|
||||||
|
|
@ -453,7 +453,7 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small)
|
void PathActor::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small)
|
||||||
{
|
{
|
||||||
if (current_sink_)
|
if (current_sink_)
|
||||||
{
|
{
|
||||||
|
|
@ -469,7 +469,7 @@ namespace kiwano
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathNode::ClearPath()
|
void PathActor::ClearPath()
|
||||||
{
|
{
|
||||||
geo_ = nullptr;
|
geo_ = nullptr;
|
||||||
current_sink_ = nullptr;
|
current_sink_ = nullptr;
|
||||||
|
|
@ -25,17 +25,17 @@
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
// ¶þάͼÐνÇÉ«
|
// ¶þάͼÐνÇÉ«
|
||||||
class KGE_API ShapeNode
|
class KGE_API ShapeActor
|
||||||
: public VisualActor
|
: public VisualActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShapeNode();
|
ShapeActor();
|
||||||
|
|
||||||
ShapeNode(
|
ShapeActor(
|
||||||
ComPtr<ID2D1Geometry> geometry
|
ComPtr<ID2D1Geometry> geometry
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~ShapeNode();
|
virtual ~ShapeActor();
|
||||||
|
|
||||||
// »ñÈ¡Ìî³äÑÕÉ«
|
// »ñÈ¡Ìî³äÑÕÉ«
|
||||||
Color GetFillColor() const { return fill_color_; }
|
Color GetFillColor() const { return fill_color_; }
|
||||||
|
|
@ -108,18 +108,18 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// Ö±Ïß
|
// Ö±Ïß
|
||||||
class KGE_API LineNode
|
class KGE_API LineActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LineNode();
|
LineActor();
|
||||||
|
|
||||||
LineNode(
|
LineActor(
|
||||||
Point const& begin,
|
Point const& begin,
|
||||||
Point const& end
|
Point const& end
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~LineNode();
|
virtual ~LineActor();
|
||||||
|
|
||||||
Point const& GetBegin() const { return begin_; }
|
Point const& GetBegin() const { return begin_; }
|
||||||
|
|
||||||
|
|
@ -145,22 +145,22 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// ¾ØÐνÇÉ«
|
// ¾ØÐνÇÉ«
|
||||||
class KGE_API RectNode
|
class KGE_API RectActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RectNode();
|
RectActor();
|
||||||
|
|
||||||
RectNode(
|
RectActor(
|
||||||
Rect const& rect
|
Rect const& rect
|
||||||
);
|
);
|
||||||
|
|
||||||
RectNode(
|
RectActor(
|
||||||
Point const& left_top,
|
Point const& left_top,
|
||||||
Size const& size
|
Size const& size
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~RectNode();
|
virtual ~RectActor();
|
||||||
|
|
||||||
Rect const& GetRect() const { return rect_; }
|
Rect const& GetRect() const { return rect_; }
|
||||||
|
|
||||||
|
|
@ -172,19 +172,19 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// Ô²½Ç¾ØÐνÇÉ«
|
// Ô²½Ç¾ØÐνÇÉ«
|
||||||
class KGE_API RoundedRectNode
|
class KGE_API RoundRectActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RoundedRectNode();
|
RoundRectActor();
|
||||||
|
|
||||||
RoundedRectNode(
|
RoundRectActor(
|
||||||
Rect const& rect,
|
Rect const& rect,
|
||||||
float radius_x,
|
float radius_x,
|
||||||
float radius_y
|
float radius_y
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~RoundedRectNode();
|
virtual ~RoundRectActor();
|
||||||
|
|
||||||
float GetRadiusX() const { return radius_x_; }
|
float GetRadiusX() const { return radius_x_; }
|
||||||
|
|
||||||
|
|
@ -215,18 +215,18 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// Ô²ÐνÇÉ«
|
// Ô²ÐνÇÉ«
|
||||||
class KGE_API CircleNode
|
class KGE_API CircleActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CircleNode();
|
CircleActor();
|
||||||
|
|
||||||
CircleNode(
|
CircleActor(
|
||||||
Point const& center,
|
Point const& center,
|
||||||
float radius
|
float radius
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~CircleNode();
|
virtual ~CircleActor();
|
||||||
|
|
||||||
float GetRadius() const { return radius_; }
|
float GetRadius() const { return radius_; }
|
||||||
|
|
||||||
|
|
@ -252,19 +252,19 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// ÍÖÔ²½ÇÉ«
|
// ÍÖÔ²½ÇÉ«
|
||||||
class KGE_API EllipseNode
|
class KGE_API EllipseActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EllipseNode();
|
EllipseActor();
|
||||||
|
|
||||||
EllipseNode(
|
EllipseActor(
|
||||||
Point const& center,
|
Point const& center,
|
||||||
float radius_x,
|
float radius_x,
|
||||||
float radius_y
|
float radius_y
|
||||||
);
|
);
|
||||||
|
|
||||||
virtual ~EllipseNode();
|
virtual ~EllipseActor();
|
||||||
|
|
||||||
float GetRadiusX() const { return radius_x_; }
|
float GetRadiusX() const { return radius_x_; }
|
||||||
|
|
||||||
|
|
@ -295,13 +295,13 @@ namespace kiwano
|
||||||
|
|
||||||
|
|
||||||
// ·¾¶½ÇÉ«
|
// ·¾¶½ÇÉ«
|
||||||
class KGE_API PathNode
|
class KGE_API PathActor
|
||||||
: public ShapeNode
|
: public ShapeActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PathNode();
|
PathActor();
|
||||||
|
|
||||||
virtual ~PathNode();
|
virtual ~PathActor();
|
||||||
|
|
||||||
// ¿ªÊ¼Ìí¼Ó·¾¶
|
// ¿ªÊ¼Ìí¼Ó·¾¶
|
||||||
void BeginPath(
|
void BeginPath(
|
||||||
|
|
@ -41,13 +41,13 @@ namespace kiwano
|
||||||
KGE_DECLARE_SMART_PTR(GifSprite);
|
KGE_DECLARE_SMART_PTR(GifSprite);
|
||||||
KGE_DECLARE_SMART_PTR(Text);
|
KGE_DECLARE_SMART_PTR(Text);
|
||||||
KGE_DECLARE_SMART_PTR(Canvas);
|
KGE_DECLARE_SMART_PTR(Canvas);
|
||||||
KGE_DECLARE_SMART_PTR(ShapeNode);
|
KGE_DECLARE_SMART_PTR(ShapeActor);
|
||||||
KGE_DECLARE_SMART_PTR(LineNode);
|
KGE_DECLARE_SMART_PTR(LineActor);
|
||||||
KGE_DECLARE_SMART_PTR(RectNode);
|
KGE_DECLARE_SMART_PTR(RectActor);
|
||||||
KGE_DECLARE_SMART_PTR(RoundedRectNode);
|
KGE_DECLARE_SMART_PTR(RoundRectActor);
|
||||||
KGE_DECLARE_SMART_PTR(CircleNode);
|
KGE_DECLARE_SMART_PTR(CircleActor);
|
||||||
KGE_DECLARE_SMART_PTR(EllipseNode);
|
KGE_DECLARE_SMART_PTR(EllipseActor);
|
||||||
KGE_DECLARE_SMART_PTR(PathNode);
|
KGE_DECLARE_SMART_PTR(PathActor);
|
||||||
|
|
||||||
KGE_DECLARE_SMART_PTR(Action);
|
KGE_DECLARE_SMART_PTR(Action);
|
||||||
KGE_DECLARE_SMART_PTR(ActionTween);
|
KGE_DECLARE_SMART_PTR(ActionTween);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#include "../2d/Actor.h"
|
#include "../2d/Actor.h"
|
||||||
#include "../2d/Stage.h"
|
#include "../2d/Stage.h"
|
||||||
#include "../2d/Transition.h"
|
#include "../2d/Transition.h"
|
||||||
#include "../2d/DebugNode.h"
|
#include "../2d/DebugActor.h"
|
||||||
|
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@
|
||||||
#include "2d/GifSprite.h"
|
#include "2d/GifSprite.h"
|
||||||
#include "2d/Text.h"
|
#include "2d/Text.h"
|
||||||
#include "2d/Canvas.h"
|
#include "2d/Canvas.h"
|
||||||
#include "2d/ShapeNode.h"
|
#include "2d/ShapeActor.h"
|
||||||
#include "2d/DebugNode.h"
|
#include "2d/DebugActor.h"
|
||||||
|
|
||||||
#include "platform/modules.h"
|
#include "platform/modules.h"
|
||||||
#include "platform/Application.h"
|
#include "platform/Application.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue