diff --git a/core/math/Color.h b/core/math/Color.h index b45575f874d..4ccffc68aec 100644 --- a/core/math/Color.h +++ b/core/math/Color.h @@ -118,7 +118,7 @@ struct AX_DLL Color4B /** * RGBA color composed of 4 floats. - * @since v3.0 + * @since v3.0, renamed from Color4F */ struct AX_DLL Color : public Vec4Adapter { @@ -161,7 +161,6 @@ struct AX_DLL Color : public Vec4Adapter static const Color GRAY; static const Color TRANSPARENT; // TRANSPARENT is defined on wingdi.h /*Background Modes*/ }; -using Color4F = Color; // DEPRECATED /** * Hue Saturation Value color space composed of 4 floats. diff --git a/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelGenerator.cpp b/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelGenerator.cpp index 8619b0189fc..b625edd0943 100644 --- a/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelGenerator.cpp +++ b/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelGenerator.cpp @@ -885,7 +885,7 @@ ModelRef ProceduralModelGenerator::Generate(const ProceduralModelParameter& para generator.Rotator = primitiveGenerator; generator.Noise = noiseFunc; generator.CrossSectionType = parameter.Ribbon.CrossSection; - generator.position = parameter.Ribbon.position; + generator.Vertices = parameter.Ribbon.Vertices; generator.Rotate = parameter.Ribbon.Rotate; generator.Count = parameter.Ribbon.Count; generator.RibbonSizes = parameter.Ribbon.RibbonSizes; @@ -923,4 +923,4 @@ void ProceduralModelGenerator::Ungenerate(ModelRef model) { } -} // namespace Effekseer \ No newline at end of file +} // namespace Effekseer diff --git a/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelParameter.h b/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelParameter.h index 1f26f402b34..914e8c548cd 100644 --- a/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelParameter.h +++ b/extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelParameter.h @@ -189,8 +189,8 @@ struct ProceduralModelParameter if (Ribbon.Rotate != rhs.Ribbon.Rotate) return Ribbon.Rotate < rhs.Ribbon.Rotate; - if (Ribbon.position != rhs.Ribbon.position) - return Ribbon.position < rhs.Ribbon.position; + if (Ribbon.Vertices != rhs.Ribbon.Vertices) + return Ribbon.Vertices < rhs.Ribbon.Vertices; if (Ribbon.RibbonSizes != rhs.Ribbon.RibbonSizes) return Ribbon.RibbonSizes < rhs.Ribbon.RibbonSizes; @@ -366,7 +366,7 @@ struct ProceduralModelParameter { reader.Read(Ribbon.CrossSection); reader.Read(Ribbon.Rotate); - reader.Read(Ribbon.position); + reader.Read(Ribbon.Vertices); reader.Read(Ribbon.RibbonSizes); reader.Read(Ribbon.RibbonAngles); reader.Read(Ribbon.RibbonNoises); @@ -471,4 +471,4 @@ struct ProceduralModelParameter } // namespace Effekseer -#endif \ No newline at end of file +#endif diff --git a/tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp index c900bb35270..a6aa2102ff7 100644 --- a/tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp @@ -1244,7 +1244,7 @@ void ActionFollow::onEnter() float y = s.height; Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)}; - drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); this->addChild(drawNode); @@ -1281,7 +1281,7 @@ void ActionFollowWithOffset::onEnter() float y = s.height; Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)}; - drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); this->addChild(drawNode); @@ -1523,7 +1523,7 @@ void ActionCatmullRomStacked::onEnter() auto drawNode1 = DrawNode::create(); drawNode1->setPosition(Vec2(50.0f, 50.0f)); - drawNode1->drawCatmullRom(array, 50, Color4F(1.0f, 1.0f, 0.0f, 0.5f)); + drawNode1->drawCatmullRom(array, 50, Color(1.0f, 1.0f, 0.0f, 0.5f)); this->addChild(drawNode1); // @@ -1552,7 +1552,7 @@ void ActionCatmullRomStacked::onEnter() MoveBy::create(0.05f, Vec2(-10.0f, 0.0f)), nullptr))); auto drawNode2 = DrawNode::create(); - drawNode2->drawCatmullRom(array2, 50, Color4F(1.0, 0.0, 0.0, 0.5)); + drawNode2->drawCatmullRom(array2, 50, Color(1.0, 0.0, 0.0, 0.5)); this->addChild(drawNode2); } @@ -1605,7 +1605,7 @@ void ActionCardinalSplineStacked::onEnter() auto drawNode1 = DrawNode::create(); drawNode1->setPosition(Vec2(50.0f, 50.0f)); - drawNode1->drawCardinalSpline(array, 0, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f)); + drawNode1->drawCardinalSpline(array, 0, 100, Color(1.0f, 0.0f, 1.0f, 1.0f)); this->addChild(drawNode1); // @@ -1628,7 +1628,7 @@ void ActionCardinalSplineStacked::onEnter() auto drawNode2 = DrawNode::create(); drawNode2->setPosition(Vec2(s.width / 2, 50.0f)); - drawNode2->drawCardinalSpline(array, 1, 100, Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNode2->drawCardinalSpline(array, 1, 100, Color(0.0f, 0.0f, 1.0f, 1.0f)); this->addChild(drawNode2); } @@ -1950,7 +1950,7 @@ void ActionCatmullRom::onEnter() auto drawNode1 = DrawNode::create(); drawNode1->setPosition(Vec2(50.0f, 50.0f)); - drawNode1->drawCatmullRom(array, 50, Color4F(1.0f, 0.0f, 1.0f, 1.0f)); + drawNode1->drawCatmullRom(array, 50, Color(1.0f, 0.0f, 1.0f, 1.0f)); this->addChild(drawNode1); // @@ -1976,7 +1976,7 @@ void ActionCatmullRom::onEnter() _kathia->runAction(seq2); auto drawNode2 = DrawNode::create(); - drawNode2->drawCatmullRom(array2, 50, Color4F(0.0f, 1.0f, 1.0f, 1.0f)); + drawNode2->drawCatmullRom(array2, 50, Color(0.0f, 1.0f, 1.0f, 1.0f)); this->addChild(drawNode2); } @@ -2026,7 +2026,7 @@ void ActionCardinalSpline::onEnter() auto drawNode1 = DrawNode::create(); drawNode1->setPosition(Vec2(50.0f, 50.0f)); - drawNode1->drawCardinalSpline(array, 0, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f)); + drawNode1->drawCardinalSpline(array, 0, 100, Color(1.0f, 0.0f, 1.0f, 1.0f)); this->addChild(drawNode1); // @@ -2045,7 +2045,7 @@ void ActionCardinalSpline::onEnter() auto drawNode2 = DrawNode::create(); drawNode2->setPosition(Vec2(s.width / 2, 50.0f)); - drawNode2->drawCardinalSpline(array, 1, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f)); + drawNode2->drawCardinalSpline(array, 1, 100, Color(1.0f, 0.0f, 1.0f, 1.0f)); this->addChild(drawNode2); } diff --git a/tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h b/tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h index 3848dc90a2c..350cbd0b795 100644 --- a/tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h +++ b/tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h @@ -9,14 +9,14 @@ struct CircleData { b2Vec2 position; float radius; - ax::Color4F rgba; + ax::Color rgba; }; struct SolidCircleData { b2Transform transform; float radius; - ax::Color4F rgba; + ax::Color rgba; }; struct CapsuleData @@ -24,7 +24,7 @@ struct CapsuleData b2Transform transform; float radius; float length; - ax::Color4F rgba; + ax::Color rgba; }; class Box2DTestDebugDrawNode : public ax::extension::PhysicsDebugNode diff --git a/tests/cpp-tests/Source/BugsTest/Bug-12847.cpp b/tests/cpp-tests/Source/BugsTest/Bug-12847.cpp index 9e5f1893287..6feb3730eab 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-12847.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-12847.cpp @@ -97,11 +97,11 @@ void Bug12847Layer::update(float dt) void Bug12847Layer::onEnter() { BugsTestBase::onEnter(); - Director::getInstance()->setClearColor(Color4F::RED); + Director::getInstance()->setClearColor(Color::RED); } void Bug12847Layer::onExit() { - Director::getInstance()->setClearColor(Color4F::BLACK); + Director::getInstance()->setClearColor(Color::BLACK); BugsTestBase::onExit(); } \ No newline at end of file diff --git a/tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp b/tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp index 1eacfbe68a4..fd4703db3f5 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp @@ -49,9 +49,9 @@ bool BugDrawNodeLayer::init() addChild(testSprite); auto drawNode = DrawNode::create(); - drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1, 0, 0, 0.5f)); + drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color(1, 0, 0, 0.5f)); Vec2 point = Vec2(size.width / 2, size.height / 2); - drawNode->drawPoint(point, 8, Color4F(1, 0, 0, 0.5f)); + drawNode->drawPoint(point, 8, Color(1, 0, 0, 0.5f)); addChild(drawNode); auto label = Label::create(); diff --git a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp index 1504d9e719f..a2b471cd648 100644 --- a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp @@ -360,16 +360,16 @@ void Camera3DTestDemo::onEnter() // draw x for (int j = -20; j <= 20; j++) { - line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color4F(1, 0, 0, 1)); + line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color(1, 0, 0, 1)); } // draw z for (int j = -20; j <= 20; j++) { - line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color4F(0, 0, 1, 1)); + line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color(0, 0, 1, 1)); } // draw y - line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color4F(0, 0.5, 0, 1)); - line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1)); + line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color(0, 0.5, 0, 1)); + line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1)); _layer3D->addChild(line); _layer3D->setCameraMask(2); @@ -809,7 +809,7 @@ void CameraCullingDemo::update(float dt) if (_cameraFirst->isVisibleInFrustum(&aabb)) { aabb.getCorners(corners); - _drawAABB->drawCube(corners, Color4F(0, 1, 0, 1)); + _drawAABB->drawCube(corners, Color(0, 1, 0, 1)); } } } @@ -934,7 +934,7 @@ void CameraCullingDemo::drawCameraFrustum() _drawFrustum->clear(); auto size = Director::getInstance()->getWinSize(); - Color4F color(1.f, 1.f, 0.f, 1); + Color color(1.f, 1.f, 0.f, 1); // top-left Vec3 tl_0, tl_1; @@ -1060,15 +1060,15 @@ void CameraArcBallDemo::onEnter() // draw x for (int j = -20; j <= 20; j++) { - _drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color4F(1, 0, 0, 1)); + _drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color(1, 0, 0, 1)); } // draw z for (int j = -20; j <= 20; j++) { - _drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color4F(0, 0, 1, 1)); + _drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color(0, 0, 1, 1)); } // draw y - _drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1)); + _drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1)); _layer3D->addChild(_drawGrid); _layer3D->setCameraMask(2); @@ -1221,7 +1221,7 @@ void FogTestDemo::onEnter() { CameraBaseTest::onEnter(); schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); - Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); + Director::getInstance()->setClearColor(Color(0.5, 0.5, 0.5, 1)); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); @@ -1296,7 +1296,7 @@ void FogTestDemo::onEnter() #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { - Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); + Director::getInstance()->setClearColor(Color(0.5, 0.5, 0.5, 1)); AX_SAFE_RELEASE_NULL(_programState1); AX_SAFE_RELEASE_NULL(_programState2); @@ -1360,7 +1360,7 @@ void FogTestDemo::switchTypeCallback(Object* sender, int type) void FogTestDemo::onExit() { CameraBaseTest::onExit(); - Director::getInstance()->setClearColor(Color4F(0, 0, 0, 1)); + Director::getInstance()->setClearColor(Color(0, 0, 0, 1)); if (_camera) { _camera = nullptr; @@ -1460,7 +1460,7 @@ void FogTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* // camera->setCameraFlag(CameraFlag::USER1); // camera->setDepth(-1); // camera->setFrameBufferObject(fbo); -// fbo->setClearColor(Color4F(1,1,1,1)); +// fbo->setClearColor(Color(1,1,1,1)); // addChild(camera); // } @@ -1511,7 +1511,7 @@ void BackgroundColorBrushTest::onEnter() // 2nd Camera auto camera = Camera::createPerspective(60, (float)s.width / s.height, 1, 1000); - auto colorBrush = CameraBackgroundBrush::createColorBrush(Color4F(.1f, .1f, 1.f, .5f), 1.f); + auto colorBrush = CameraBackgroundBrush::createColorBrush(Color(.1f, .1f, 1.f, .5f), 1.f); camera->setBackgroundBrush(colorBrush); camera->setPosition3D(Vec3(0.0f, 0.0f, 200.0f)); camera->lookAt(Vec3::ZERO); @@ -1527,7 +1527,7 @@ void BackgroundColorBrushTest::onEnter() slider->setPosition(Vec2(s.width / 2, s.height / 4)); slider->setPercent(50); slider->addEventListener([slider, colorBrush](Object*, ui::Slider::EventType) { - colorBrush->setColor(Color4F(.1f, .1f, 1.f, (float)slider->getPercent() / 100.f)); + colorBrush->setColor(Color(.1f, .1f, 1.f, (float)slider->getPercent() / 100.f)); }); addChild(slider); diff --git a/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp index a1f890edd5e..909aea78abd 100644 --- a/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp @@ -152,7 +152,7 @@ DrawNode* BasicTest::shape() triangle[1] = Vec2(100, -100); triangle[2] = Vec2(0, 100); - static Color4F green(0, 1, 0, 1); + static Color green(0, 1, 0, 1); shape->drawPolygon(triangle, 3, green, 0, green); return shape; } @@ -464,7 +464,7 @@ void ScrollViewDemo::setup() rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height); rectangle[3] = Vec2(0.0f, clipper->getContentSize().height); - Color4F white(1, 1, 1, 1); + Color white(1, 1, 1, 1); stencil->drawPolygon(rectangle, 4, white, 1, white); clipper->setStencil(stencil); @@ -623,7 +623,7 @@ void RawStencilBufferTest::draw(Renderer* renderer, const Mat4& transform, uint3 _sprites.at(i)->setPosition(spritePoint); _spritesStencil.at(i)->setPosition(spritePoint); - renderer->clear(ClearFlag::STENCIL, Color4F::BLACK, 0.f, 0x0, _globalZOrder); + renderer->clear(ClearFlag::STENCIL, Color::BLACK, 0.f, 0x0, _globalZOrder); renderer->addCommand(&_renderCmds[cmdIndex]); cmdIndex++; @@ -870,7 +870,7 @@ void ClippingToRenderTextureTest::expectedBehaviour() triangle[0] = Point(-50, -50); triangle[1] = Point(50, -50); triangle[2] = Point(0, 50); - Color4F green(0, 1, 0, 1); + Color green(0, 1, 0, 1); stencil->drawPolygon(triangle, 3, green, 0, green); auto clipper = ClippingNode::create(); @@ -884,7 +884,7 @@ void ClippingToRenderTextureTest::expectedBehaviour() triangle[0] = Point(-200, -200); triangle[1] = Point(200, -200); triangle[2] = Point(0, 200); - Color4F red(1, 0, 0, 1); + Color red(1, 0, 0, 1); img->drawPolygon(triangle, 3, red, 0, red); clipper->addChild(img); } @@ -913,7 +913,7 @@ void ClippingToRenderTextureTest::reproduceBug() triangle[0] = Point(-50, -50); triangle[1] = Point(50, -50); triangle[2] = Point(0, 50); - Color4F green(0, 1, 0, 1); + Color green(0, 1, 0, 1); stencil->drawPolygon(triangle, 3, green, 0, green); auto clipper = ClippingNode::create(); @@ -927,7 +927,7 @@ void ClippingToRenderTextureTest::reproduceBug() triangle[0] = Point(-200, -200); triangle[1] = Point(200, -200); triangle[2] = Point(0, 200); - Color4F red(1, 0, 0, 1); + Color red(1, 0, 0, 1); img->drawPolygon(triangle, 3, red, 0, red); clipper->addChild(img); diff --git a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp index 1a2e6fe28c7..e6f67c832ce 100644 --- a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp +++ b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp @@ -207,7 +207,7 @@ DrawNodeExTests::DrawNodeExTests() DrawNodeExBaseTest::DrawNodeExBaseTest() { auto director = Director::getInstance(); - director->setClearColor(Color4F(0, 0, 0, 0)); + director->setClearColor(Color(0, 0, 0, 0)); origin = director->getVisibleOrigin(); size = director->getVisibleSize(); @@ -443,7 +443,7 @@ DrawNodeMorphTest_SolidPolygon::DrawNodeMorphTest_SolidPolygon() drawNodeExArray[n] = DrawNodeEx::create(); addChild(drawNodeExArray[n]); drawNodeExArray[n]->setPosition(Vec2(AXRANDOM_MINUS1_1() * size.width / 4, AXRANDOM_MINUS1_1() * size.height / 4) + Vec2(100, 100)); - color[n] = Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); + color[n] = Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); rad[n] = 90 + AXRANDOM_0_1() * 10; state[n] = (AXRANDOM_0_1() > 0.5f) ? false : true; @@ -564,7 +564,7 @@ DrawNodeMorphTest_Polygon::DrawNodeMorphTest_Polygon() drawNodeExArray[n] = DrawNodeEx::create(); addChild(drawNodeExArray[n]); drawNodeExArray[n]->setPosition(Vec2(AXRANDOM_MINUS1_1() * size.width / 4, AXRANDOM_MINUS1_1() * size.height / 4) + Vec2(100, 100)); - color[n] = Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); + color[n] = Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); rad[n] = 90 + AXRANDOM_0_1() * 10; state[n] = (AXRANDOM_0_1() > 0.5f) ? false : true; @@ -719,8 +719,8 @@ void DrawNodePictureTest::update(float dt) int sph_la = 0; do { - Color4F color = Color4F(sph_xx[sph_la + 1], sph_yy[sph_la + 1], sph_xx[sph_la + 2], sph_yy[sph_la + 2] * 255); - // color = Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1); + Color color = Color(sph_xx[sph_la + 1], sph_yy[sph_la + 1], sph_xx[sph_la + 2], sph_yy[sph_la + 2] * 255); + // color = Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1); Vec2* vertices = new Vec2[(int)(sph_cmb - 3)]; for (int n = 3; n < sph_cmb; n++) { @@ -734,7 +734,7 @@ void DrawNodePictureTest::update(float dt) drawNodeEx->setDNCenter(vertices[0]); drawNodeEx->setDNRotation(rot); drawNodeEx->setIsConvex(true); - drawNodeEx->drawPolygon(vertices, sph_cmb - 3, color, /*rot*/0.f, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPolygon(vertices, sph_cmb - 3, color, /*rot*/0.f, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); drawNodeEx->setIsConvex(false); sph_la += sph_cmb; @@ -760,46 +760,46 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() addChild(draw, 10); draw->drawPoint(Vec2(size.width / 2 - 120, size.height / 2 - 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); draw->drawPoint(Vec2(size.width / 2 + 120, size.height / 2 + 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // draw 4 small points Vec2 position[] = { Vec2(60, 60), Vec2(70, 70), Vec2(60, 70), Vec2(70, 60) }; - draw->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + draw->drawPoints(position, 4, 5, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // draw a line - draw->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1.0f, 0.0f, 0.0f, 1.0f)); + draw->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color(1.0f, 0.0f, 0.0f, 1.0f)); // draw a rectangle - draw->drawRect(Vec2(23, 23), Vec2(7, 7), Color4F(1, 1, 0, 1.0f)); + draw->drawRect(Vec2(23, 23), Vec2(7, 7), Color(1, 1, 0, 1.0f)); draw->drawRect(Vec2(15, 30), Vec2(30, 15), Vec2(15, 0), Vec2(0, 15), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // draw a circle draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, - Color4F(1.0f, 0.0f, 0.0f, 0.5f)); + Color(1.0f, 0.0f, 0.0f, 0.5f)); draw->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_DEGREES_TO_RADIANS(90), 30, false, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // Draw some beziers draw->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10), Vec2(size.width - 10, size.height - 10), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); draw->drawQuadBezier(Vec2(0.0f, size.height), Vec2(size.width / 2, size.height / 2), Vec2(size.width, size.height), 50, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); draw->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), 100, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); draw->drawCubicBezier(Vec2(size.width - 250, 40.0f), Vec2(size.width - 70, 100.0f), Vec2(size.width - 30, 250.0f), Vec2(size.width - 10, size.height - 50), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); auto array = PointArray::create(20); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -809,7 +809,7 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - draw->drawCardinalSpline(array, 0.5f, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + draw->drawCardinalSpline(array, 0.5f, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); auto array2 = PointArray::create(20); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); @@ -817,28 +817,28 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); - draw->drawCatmullRom(array2, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + draw->drawCatmullRom(array2, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // open random color poly Vec2 vertices[] = { Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f) }; - draw->drawPoly(vertices, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + draw->drawPoly(vertices, 5, false, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // closed random color poly Vec2 vertices2[] = { Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f) }; - draw->drawPoly(vertices2, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + draw->drawPoly(vertices2, 3, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // Draw 10 circles for (int i = 0; i < 10; i++) { draw->drawDot(Vec2(size.width / 2, size.height / 2), 10.f * (10 - i), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } // Draw polygons Vec2 points[] = { Vec2(size.height / 4, 0.0f), Vec2(size.width, size.height / 5), Vec2(size.width / 3 * 2, size.height) }; - draw->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color4F(1.0f, 0.0f, 0.0f, 1.0f), 4, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + draw->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color(1.0f, 0.0f, 0.0f, 1.0f), 4, + Color(0.0f, 0.0f, 1.0f, 1.0f)); // star poly (triggers buggs) { @@ -852,8 +852,8 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() // {o -h, o+w}, {o,o}, // left spike }; - draw->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 1.0f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + draw->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 1.0f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // star poly (doesn't trigger bug... order is important un tesselation is supported. @@ -872,55 +872,55 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() Vec2(o - h, o + w), // left spike }; - draw->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 1.0f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + draw->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 1.0f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // draw a solid polygon Vec2 vertices3[] = { Vec2(60.0f, 160.0f), Vec2(70.0f, 190.0f), Vec2(100.0f, 190.0f), Vec2(90.0f, 160.0f) }; - draw->drawSolidPoly(vertices3, 4, Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + draw->drawSolidPoly(vertices3, 4, Color(1.0f, 1.0f, 0.0f, 1.0f)); // draw a solid rectangle - draw->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + draw->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color(1.0f, 1.0f, 0.0f, 1.0f)); // draw a solid circle draw->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + Color(0.0f, 1.0f, 0.0f, 1.0f)); // Draw segment - draw->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + draw->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color(0.0f, 1.0f, 0.0f, 1.0f)); - draw->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color4F(1.0f, 0.0f, 1.0f, 1.0f)); + draw->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color(1.0f, 0.0f, 1.0f, 1.0f)); // Draw triangle draw->drawTriangle(Vec2(10.0f, 10.0f), Vec2(70.0f, 30.0f), Vec2(100.0f, 140.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); for (int i = 0; i < 100; i++) { draw->drawPoint(Vec2(i * 7.0f, 5.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } auto draw1 = DrawNodeEx::create(); this->addChild(draw1, 10); draw1->setLineWidth(4); - draw1->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color4F::YELLOW); - draw1->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color4F::YELLOW); + draw1->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color::YELLOW); + draw1->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color::YELLOW); Vec2 startPos = Vec2(0.0f, 0.0f); Vec2 destination = Vec2(100.f + AXRANDOM_0_1() * VisibleRect::rightTop().x, 100.f + AXRANDOM_0_1() * VisibleRect::rightTop().y); // Lines - drawNodeEx->drawLine(startPos, destination, Color4F::YELLOW, 200); + drawNodeEx->drawLine(startPos, destination, Color::YELLOW, 200); // Points for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(120.0f, i * 7.0f), (float)i / 5 + 1, - Color4F::BLUE); + Color::BLUE); } @@ -933,14 +933,14 @@ DrawNodeDrawOrderTest::DrawNodeDrawOrderTest() // Lines - drawNodeEx->drawLine(Vec2(0.0f, 0.0f), destination, Color4F::RED, 200); + drawNodeEx->drawLine(Vec2(0.0f, 0.0f), destination, Color::RED, 200); // Points for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(80.0f, i * 7.0f), (float)i / 5 + 1, - Color4F::MAGENTA); + Color::MAGENTA); } // Polygons @@ -984,17 +984,17 @@ void DrawNodeThicknessTest::update(float dt) drawNodeEx->clear(); drawNodeEx->drawCircle(VisibleRect::center(), 60, AX_DEGREES_TO_RADIANS(77), 30, false, - Color4F::GREEN, sliderValue[sliderType::Thickness]); + Color::GREEN, sliderValue[sliderType::Thickness]); - drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color4F::YELLOW, sliderValue[sliderType::Thickness]); - drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color4F::YELLOW, sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color::YELLOW, sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color::YELLOW, sliderValue[sliderType::Thickness]); // drawNodeEx a rectangles - drawNodeEx->drawRect(Vec2(123, 123), Vec2(227, 227), Color4F(1, 1, 0, 1), sliderValue[sliderType::Thickness]); - drawNodeEx->drawRect(Vec2(115, 130), Vec2(130, 115), Vec2(115, 100), Vec2(100, 115), Color4F::MAGENTA, sliderValue[sliderType::Thickness]); + drawNodeEx->drawRect(Vec2(123, 123), Vec2(227, 227), Color(1, 1, 0, 1), sliderValue[sliderType::Thickness]); + drawNodeEx->drawRect(Vec2(115, 130), Vec2(130, 115), Vec2(115, 100), Vec2(100, 115), Color::MAGENTA, sliderValue[sliderType::Thickness]); - drawNodeEx->drawLine(Vec2(200.0f, size.height - 20), Vec2(size.width - 100, size.height - 20), Color4F::YELLOW, sliderValue[sliderType::Thickness]); - drawNodeEx->drawLine(Vec2(300.0f, 100.0f), Vec2(size.width - 200, size.height - 120), Color4F::GREEN, sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(200.0f, size.height - 20), Vec2(size.width - 100, size.height - 20), Color::YELLOW, sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(300.0f, 100.0f), Vec2(size.width - 200, size.height - 120), Color::GREEN, sliderValue[sliderType::Thickness]); Vec2 vertices24[] = { {45.750000f, 144.375000f}, {75.500000f, 136.875000f}, {75.500000f, 159.125000f}, {100.250000f, 161.375000f}, @@ -1012,30 +1012,30 @@ void DrawNodeThicknessTest::update(float dt) {88.000000f, 116.875000f}, {106.000000f, 103.875000f}, {88.000000f, 97.875000f}, }; drawNodeEx->drawPolygon(vertices24, sizeof(vertices24) / sizeof(vertices24[0]), Color4B::TRANSPARENT, sliderValue[sliderType::Thickness] / 2, - Color4F::RED); + Color::RED); // open random color poly Vec2 vertices[] = { Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f) }; - drawNodeEx->drawPoly(vertices, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices, 5, false, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); // closed random color poly Vec2 vertices2[] = { Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f) }; - drawNodeEx->drawPoly(vertices2, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices2, 3, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); // drawNodeEx some beziers drawNodeEx->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10), - Vec2(size.width - 10, size.height - 10), 10, Color4F::BLUE, sliderValue[sliderType::Thickness]); + Vec2(size.width - 10, size.height - 10), 10, Color::BLUE, sliderValue[sliderType::Thickness]); drawNodeEx->drawQuadBezier(Vec2(0.0f + 100, size.height - 100), Vec2(size.width / 2, size.height / 2), - Vec2(size.width - 100, size.height - 100), 50, Color4F::RED, sliderValue[sliderType::Thickness]); + Vec2(size.width - 100, size.height - 100), 50, Color::RED, sliderValue[sliderType::Thickness]); drawNodeEx->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), - 100, Color4F::WHITE, sliderValue[sliderType::Thickness]); + 100, Color::WHITE, sliderValue[sliderType::Thickness]); drawNodeEx->drawCubicBezier(Vec2(size.width - 250, 40.0f), Vec2(size.width - 70, 100.0f), Vec2(size.width - 30, 250.0f), - Vec2(size.width - 10, size.height - 50), 10, Color4F::GRAY, sliderValue[sliderType::Thickness]); + Vec2(size.width - 10, size.height - 50), 10, Color::GRAY, sliderValue[sliderType::Thickness]); auto array = ax::PointArray::create(20); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -1045,7 +1045,7 @@ void DrawNodeThicknessTest::update(float dt) array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color4F::MAGENTA, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color::MAGENTA, sliderValue[sliderType::Thickness]); auto array2 = ax::PointArray::create(20); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); @@ -1053,53 +1053,53 @@ void DrawNodeThicknessTest::update(float dt) array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); - drawNodeEx->drawCatmullRom(array2, 50, Color4F::ORANGE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCatmullRom(array2, 50, Color::ORANGE, sliderValue[sliderType::Thickness]); auto s = Director::getInstance()->getWinSize(); drawNodeEx->drawPoint(Vec2(s.width / 2 - 120, s.height / 2 - 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); drawNodeEx->drawPoint(Vec2(s.width / 2 + 120, s.height / 2 + 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx 4 small points Vec2 position[] = { Vec2(60, 60), Vec2(70, 70), Vec2(60, 70), Vec2(70, 60) }; - drawNodeEx->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position, 4, 5, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a line - drawNodeEx->drawLine(Vec2(0, 0), Vec2(s.width, s.height), Color4F(1.0, 0.0, 0.0, 0.5)); + drawNodeEx->drawLine(Vec2(0, 0), Vec2(s.width, s.height), Color(1.0, 0.0, 0.0, 0.5)); // drawNodeEx a rectangle - drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color4F(1, 1, 0, 1)); + drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color(1, 1, 0, 1)); drawNodeEx->drawRect(Vec2(15, 30), Vec2(30, 15), Vec2(15, 0), Vec2(0, 15), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a circle drawNodeEx->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, - Color4F(1.0f, 0.0f, 0.0f, 0.5f)); + Color(1.0f, 0.0f, 0.0f, 0.5f)); drawNodeEx->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_DEGREES_TO_RADIANS(90), 30, false, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx some beziers drawNodeEx->drawQuadBezier(Vec2(s.width - 150, s.height - 150), Vec2(s.width - 70, s.height - 10), Vec2(s.width - 10, s.height - 10), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawQuadBezier(Vec2(0.0f, s.height), Vec2(s.width / 2, s.height / 2), Vec2(s.width, s.height), 50, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), 100, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(Vec2(s.width - 250, 40.0f), Vec2(s.width - 70, 100.0f), Vec2(s.width - 30, 250.0f), Vec2(s.width - 10, s.height - 50), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array3 = PointArray::create(20); array3->addControlPoint(Vec2(0.0f, 0.0f)); @@ -1109,7 +1109,7 @@ void DrawNodeThicknessTest::update(float dt) array3->addControlPoint(Vec2(80.0f, s.height - 80)); array3->addControlPoint(Vec2(80.0f, 80.0f)); array3->addControlPoint(Vec2(s.width / 2, s.height / 2)); - drawNodeEx->drawCardinalSpline(array3, 0.5f, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCardinalSpline(array3, 0.5f, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array4 = PointArray::create(20); array4->addControlPoint(Vec2(s.width / 2, 30.0f)); @@ -1117,28 +1117,28 @@ void DrawNodeThicknessTest::update(float dt) array4->addControlPoint(Vec2(s.width - 80, s.height - 80)); array4->addControlPoint(Vec2(s.width / 2, s.height - 80)); array4->addControlPoint(Vec2(s.width / 2, 30.0f)); - drawNodeEx->drawCatmullRom(array4, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCatmullRom(array4, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); // open random color poly Vec2 verticesA[] = { Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f) }; - drawNodeEx->drawPoly(verticesA, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(verticesA, 5, false, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // closed random color poly Vec2 verticesB[] = { Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f) }; - drawNodeEx->drawPoly(verticesB, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(verticesB, 3, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx 10 circles for (int i = 0; i < 10; i++) { drawNodeEx->drawDot(Vec2(s.width / 2, s.height / 2), 10.f * (10 - i), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } // drawNodeEx polygons Vec2 points[] = { Vec2(s.height / 4, 0.0f), Vec2(s.width, s.height / 5), Vec2(s.width / 3 * 2, s.height) }; - drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 4, - Color4F(0.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 4, + Color(0.0f, 0.0f, 1.0f, 0.5f)); // star poly (triggers buggs) { @@ -1152,8 +1152,8 @@ void DrawNodeThicknessTest::update(float dt) // {o -h, o+w}, {o,o}, // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // star poly (doesn't trigger bug... order is important un tesselation is supported. @@ -1172,40 +1172,40 @@ void DrawNodeThicknessTest::update(float dt) Vec2(o - h, o + w), // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // drawNodeEx a solid polygon Vec2 vertices3[] = { Vec2(60.0f, 160.0f), Vec2(70.0f, 190.0f), Vec2(100.0f, 190.0f), Vec2(90.0f, 160.0f) }; - drawNodeEx->drawSolidPoly(vertices3, 4, Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidPoly(vertices3, 4, Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid rectangle - drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid circle drawNodeEx->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + Color(0.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx segment - drawNodeEx->drawSegment(Vec2(20.0f, s.height), Vec2(20.0f, s.height / 2), 10, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSegment(Vec2(20.0f, s.height), Vec2(20.0f, s.height / 2), 10, Color(0.0f, 1.0f, 0.0f, 1.0f)); - drawNodeEx->drawSegment(Vec2(10.0f, s.height / 2), Vec2(s.width / 2, s.height / 2), 40, Color4F(1.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawSegment(Vec2(10.0f, s.height / 2), Vec2(s.width / 2, s.height / 2), 40, Color(1.0f, 0.0f, 1.0f, 0.5f)); // drawNodeEx triangle drawNodeEx->drawTriangle(Vec2(10.0f, 10.0f), Vec2(70.0f, 30.0f), Vec2(100.0f, 140.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(i * 7.0f, 5.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } drawNodeEx->setLineWidth(4); - drawNodeEx->drawLine(Vec2(0.0f, s.height), Vec2(s.width, s.height - 20), Color4F::YELLOW); - drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(s.width, s.height - 20), Color4F::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, s.height), Vec2(s.width, s.height - 20), Color::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(s.width, s.height - 20), Color::YELLOW); drawNodeEx->runAction(RepeatForever::create(Sequence::create(FadeIn::create(1.2f), FadeOut::create(1.2f), NULL))); } @@ -1255,23 +1255,23 @@ void DrawNodePieTest::update(float dt) // Filled drawNodeEx->drawPie(VisibleRect::center() - Vec2(190.0f, -35.0f), 40, sliderValue[sliderType::Rotation], sliderValue[sliderType::AngleStart], sliderValue[sliderType::AngleEnd], 1.0f, 1.0f, - Color4F::RED, Color4F::BLUE, drawNodeEx->DrawMode::Fill, sliderValue[sliderType::Thickness]); + Color::RED, Color::BLUE, drawNodeEx->DrawMode::Fill, sliderValue[sliderType::Thickness]); // Outlined drawNodeEx->drawPie(VisibleRect::center() - Vec2(95.0f, -35.0f), 40, sliderValue[sliderType::Rotation], sliderValue[sliderType::AngleStart], sliderValue[sliderType::AngleEnd], 1.0f, 1.0f, - Color4F::TRANSPARENT, Color4F::BLUE, drawNodeEx->DrawMode::Outline, sliderValue[sliderType::Thickness]); + Color::TRANSPARENT, Color::BLUE, drawNodeEx->DrawMode::Outline, sliderValue[sliderType::Thickness]); // Line drawNodeEx->drawPie(VisibleRect::center() + Vec2(0.0f, 35.0f), 40, sliderValue[sliderType::Rotation], sliderValue[sliderType::AngleStart], sliderValue[sliderType::AngleEnd], 1.0f, 1.0f, - Color4F::TRANSPARENT, Color4F::BLUE, drawNodeEx->DrawMode::Line, sliderValue[sliderType::Thickness]); + Color::TRANSPARENT, Color::BLUE, drawNodeEx->DrawMode::Line, sliderValue[sliderType::Thickness]); // Semi drawNodeEx->drawPie(VisibleRect::center() + Vec2(95.0f, 35.0f), 40, sliderValue[sliderType::Rotation], sliderValue[sliderType::AngleStart], sliderValue[sliderType::AngleEnd], 1.0f, 1.0f, - Color4F::TRANSPARENT, Color4F::BLUE, drawNodeEx->DrawMode::Semi, sliderValue[sliderType::Thickness]); + Color::TRANSPARENT, Color::BLUE, drawNodeEx->DrawMode::Semi, sliderValue[sliderType::Thickness]); // Semi (Filled) drawNodeEx->drawPie(VisibleRect::center() + Vec2(190.0f, 35.0f), 40, sliderValue[sliderType::Rotation], sliderValue[sliderType::AngleStart], sliderValue[sliderType::AngleEnd], 1.0f, 1.0f, - Color4F::RED, Color4F::BLUE, drawNodeEx->DrawMode::Semi, sliderValue[sliderType::Thickness]); + Color::RED, Color::BLUE, drawNodeEx->DrawMode::Semi, sliderValue[sliderType::Thickness]); } void DrawNodePieTest::onEnter() @@ -1416,8 +1416,8 @@ void DrawNodeMethodsTest::drawAll() { for (int i = 0; i < 100; i++) { - drawNodeEx->drawLine(Vec2(-size.x / 2, -size.y / 2 + i * 4), Vec2(size.x - 50, -size.y / 2 + i * 4), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); - drawNodeEx->drawLine(Vec2(-size.x + 50, -size.y + AXRANDOM_0_1() * 2 * size.y), Vec2(size.x - 50, -size.y + AXRANDOM_0_1() * 2 * size.y), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(-size.x / 2, -size.y / 2 + i * 4), Vec2(size.x - 50, -size.y / 2 + i * 4), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawLine(Vec2(-size.x + 50, -size.y + AXRANDOM_0_1() * 2 * size.y), Vec2(size.x - 50, -size.y + AXRANDOM_0_1() * 2 * size.y), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); } break; @@ -1428,8 +1428,8 @@ void DrawNodeMethodsTest::drawAll() for (int i = 0; i < 100; i++) { rec = Vec2(i * 3, i * 3); - drawNodeEx->drawRect(center / 2 - rec, center / 2 + rec, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); - drawNodeEx->drawRect(Vec2(AXRANDOM_MINUS1_1() * 300, AXRANDOM_MINUS1_1() * 300), Vec2(AXRANDOM_MINUS1_1() * 400, AXRANDOM_MINUS1_1() * 400), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawRect(center / 2 - rec, center / 2 + rec, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawRect(Vec2(AXRANDOM_MINUS1_1() * 300, AXRANDOM_MINUS1_1() * 300), Vec2(AXRANDOM_MINUS1_1() * 400, AXRANDOM_MINUS1_1() * 400), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); } break; @@ -1439,11 +1439,11 @@ void DrawNodeMethodsTest::drawAll() for (int i = 0; i < 100; i++) { drawNodeEx->drawCircle(VisibleRect::center(), 3 * i, AX_DEGREES_TO_RADIANS(90), i, false, 1.0f, 1.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); Vec2 pos = Vec2(-100, -100) + Vec2(AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y); drawNodeEx->drawCircle(VisibleRect::center() + pos, AXRANDOM_0_1() * 200, AX_DEGREES_TO_RADIANS(AXRANDOM_MINUS1_1() * 90), 30, true, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); } break; @@ -1451,9 +1451,9 @@ void DrawNodeMethodsTest::drawAll() case drawMethodes::QuadBezier: { drawNodeEx->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10), - Vec2(size.width - 10, size.height - 10), 10, Color4F::BLUE, sliderValue[sliderType::Thickness]); + Vec2(size.width - 10, size.height - 10), 10, Color::BLUE, sliderValue[sliderType::Thickness]); drawNodeEx->drawQuadBezier(Vec2(0.0f + 100, size.height - 100), Vec2(size.width / 2, size.height / 2), - Vec2(size.width - 100, size.height - 100), 50, Color4F::RED, sliderValue[sliderType::Thickness]); + Vec2(size.width - 100, size.height - 100), 50, Color::RED, sliderValue[sliderType::Thickness]); for (int i = 0; i < 360;) @@ -1463,7 +1463,7 @@ void DrawNodeMethodsTest::drawAll() Vec2 p3 = pts->getControlPointAtIndex(i); drawNodeEx->setDNPosition(Vec2(-100, -100)); - drawNodeEx->drawQuadBezier(p1, p2, p3, 30, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawQuadBezier(p1, p2, p3, 30, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); } for (int i = 0; i < 360;) @@ -1473,7 +1473,7 @@ void DrawNodeMethodsTest::drawAll() Vec2 p3 = pts2->getControlPointAtIndex(i); drawNodeEx->setDNPosition(Vec2(-100, -100)); - drawNodeEx->drawQuadBezier(p1, p2, p3, 30, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawQuadBezier(p1, p2, p3, 30, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness]); } break; @@ -1482,9 +1482,9 @@ void DrawNodeMethodsTest::drawAll() { drawNodeEx->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), - 20, Color4F::WHITE, sliderValue[sliderType::Thickness]); + 20, Color::WHITE, sliderValue[sliderType::Thickness]); drawNodeEx->drawCubicBezier(Vec2(size.width - 250, 40.0f), Vec2(size.width - 70, 100.0f), Vec2(size.width - 30, 250.0f), - Vec2(size.width - 10, size.height - 50), 20, Color4F::GRAY, sliderValue[sliderType::Thickness]); + Vec2(size.width - 10, size.height - 50), 20, Color::GRAY, sliderValue[sliderType::Thickness]); @@ -1495,7 +1495,7 @@ void DrawNodeMethodsTest::drawAll() Vec2 p3 = pts->getControlPointAtIndex(i++); Vec2 p4 = pts->getControlPointAtIndex(i); drawNodeEx->setDNPosition(Vec2(-100, -100)); - drawNodeEx->drawCubicBezier(p1, p2, p3, p4, 120, Color4F::ORANGE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCubicBezier(p1, p2, p3, p4, 120, Color::ORANGE, sliderValue[sliderType::Thickness]); } for (int i = 0; i < 360;) @@ -1505,7 +1505,7 @@ void DrawNodeMethodsTest::drawAll() Vec2 p3 = pts2->getControlPointAtIndex(i++); Vec2 p4 = pts2->getControlPointAtIndex(i); drawNodeEx->setDNPosition(Vec2(-100, -100)); - drawNodeEx->drawCubicBezier(p1, p2, p3, p4, 120, Color4F::ORANGE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCubicBezier(p1, p2, p3, p4, 120, Color::ORANGE, sliderValue[sliderType::Thickness]); } break; @@ -1520,7 +1520,7 @@ void DrawNodeMethodsTest::drawAll() array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - drawNodeEx->drawCardinalSpline(array, 0.5f, 120, Color4F::MAGENTA, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCardinalSpline(array, 0.5f, 120, Color::MAGENTA, sliderValue[sliderType::Thickness]); auto array2 = ax::PointArray::create(5); array2->addControlPoint(Vec2(size.width / 2, 80.0f)); @@ -1528,11 +1528,11 @@ void DrawNodeMethodsTest::drawAll() array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 80.0f)); - drawNodeEx->drawCardinalSpline(array2, 5.0f, 120, Color4F::ORANGE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCardinalSpline(array2, 5.0f, 120, Color::ORANGE, sliderValue[sliderType::Thickness]); - drawNodeEx->drawCardinalSpline(pts, 0.1f, 360, Color4F::RED, 5.0f); - drawNodeEx->drawCardinalSpline(pts2, 0.1f, 360, Color4F::GREEN, 2.0f); + drawNodeEx->drawCardinalSpline(pts, 0.1f, 360, Color::RED, 5.0f); + drawNodeEx->drawCardinalSpline(pts2, 0.1f, 360, Color::GREEN, 2.0f); break; } @@ -1544,7 +1544,7 @@ void DrawNodeMethodsTest::drawAll() array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 80.0f)); - drawNodeEx->drawCatmullRom(array2, 20, Color4F::ORANGE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCatmullRom(array2, 20, Color::ORANGE, sliderValue[sliderType::Thickness]); auto array = ax::PointArray::create(7); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -1554,11 +1554,11 @@ void DrawNodeMethodsTest::drawAll() array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - drawNodeEx->drawCatmullRom(array, 20, Color4F::MAGENTA, sliderValue[sliderType::Thickness]); + drawNodeEx->drawCatmullRom(array, 20, Color::MAGENTA, sliderValue[sliderType::Thickness]); - drawNodeEx->drawCatmullRom(pts, 360, Color4F::RED, 5.0f); - drawNodeEx->drawCatmullRom(pts2, 360, Color4F::GREEN, 2.0f); + drawNodeEx->drawCatmullRom(pts, 360, Color::RED, 5.0f); + drawNodeEx->drawCatmullRom(pts2, 360, Color::GREEN, 2.0f); break; } @@ -1576,59 +1576,59 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->setDNPosition(Vec2(0, -300)); drawNodeEx->setDNRotation(sliderValue[sliderType::Rotation]); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::GREEN, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::GREEN, sliderValue[sliderType::Thickness]); drawNodeEx->setDNPosition(Vec2(-100, -300)); drawNodeEx->setDNRotation(sliderValue[sliderType::Rotation]); drawNodeEx->setDNCenter(vertices1[0]); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::MAGENTA, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::MAGENTA, sliderValue[sliderType::Thickness]); drawNodeEx->setDNPosition(Vec2(200, 0)); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::RED, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::RED, sliderValue[sliderType::Thickness]); drawNodeEx->setDNPosition(Vec2(0.0f, -300.0f)); drawNodeEx->setDNRotation(rotation / 10.0f); drawNodeEx->setDNScale(Vec2(2.0f, 2.0f)); drawNodeEx->setDNCenter(vertices1[4]); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::BLUE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::BLUE, sliderValue[sliderType::Thickness]); drawNodeEx->setDNRotation(rotation); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::YELLOW, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::YELLOW, sliderValue[sliderType::Thickness]); drawNodeEx->setDNRotation(-rotation / 5); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::WHITE, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::WHITE, sliderValue[sliderType::Thickness]); drawNodeEx->resetDNValues(); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::GREEN, sliderValue[sliderType::Thickness]); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::GREEN, sliderValue[sliderType::Thickness]); break; } case drawMethodes::Polygon: { drawNodeEx->setDNPosition(Vec2(0, -300)); drawNodeEx->setDNRotation(sliderValue[sliderType::Rotation]); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::GREEN, sliderValue[sliderType::Thickness], - Color4F::YELLOW); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::GREEN, sliderValue[sliderType::Thickness], + Color::YELLOW); drawNodeEx->setDNPosition(Vec2(-100, -300)); drawNodeEx->setDNRotation(sliderValue[sliderType::Rotation]); drawNodeEx->setDNCenter(vertices1[0]); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::MAGENTA, sliderValue[sliderType::Thickness], - Color4F::GRAY); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::MAGENTA, sliderValue[sliderType::Thickness], + Color::GRAY); drawNodeEx->setDNPosition(Vec2(200, 0)); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::RED, sliderValue[sliderType::Thickness], - Color4F::YELLOW); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::RED, sliderValue[sliderType::Thickness], + Color::YELLOW); drawNodeEx->setDNPosition(Vec2(0.0f, -300.0f)); drawNodeEx->setDNRotation(rotation / 10.0f); drawNodeEx->setDNScale(Vec2(2.0f, 2.0f)); drawNodeEx->setDNCenter(vertices1[4]); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::BLUE, sliderValue[sliderType::Thickness], - Color4F::WHITE); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::BLUE, sliderValue[sliderType::Thickness], + Color::WHITE); drawNodeEx->setDNRotation(rotation); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::YELLOW, sliderValue[sliderType::Thickness], - Color4F::GREEN);; + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::YELLOW, sliderValue[sliderType::Thickness], + Color::GREEN);; drawNodeEx->setDNRotation(-rotation / 5); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::WHITE, sliderValue[sliderType::Thickness], - Color4F::YELLOW); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::WHITE, sliderValue[sliderType::Thickness], + Color::YELLOW); drawNodeEx->resetDNValues(); - drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::GREEN, sliderValue[sliderType::Thickness], - Color4F::BLUE); + drawNodeEx->drawPolygon(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::GREEN, sliderValue[sliderType::Thickness], + Color::BLUE); break; } @@ -1636,7 +1636,7 @@ void DrawNodeMethodsTest::drawAll() { for (int i = 0; i < 100; i++) { - drawNodeEx->drawDot(Vec2(AXRANDOM_MINUS1_1() * 400 + 200, AXRANDOM_MINUS1_1() * 400), 20 + sliderValue[sliderType::Thickness], Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawDot(Vec2(AXRANDOM_MINUS1_1() * 400 + 200, AXRANDOM_MINUS1_1() * 400), 20 + sliderValue[sliderType::Thickness], Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; @@ -1645,7 +1645,7 @@ void DrawNodeMethodsTest::drawAll() { for (int i = 0; i < 100; i++) { - drawNodeEx->drawPoint(Vec2(AXRANDOM_MINUS1_1() * 400 + 200, AXRANDOM_MINUS1_1() * 400), 30 + sliderValue[sliderType::Thickness], Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoint(Vec2(AXRANDOM_MINUS1_1() * 400 + 200, AXRANDOM_MINUS1_1() * 400), 30 + sliderValue[sliderType::Thickness], Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; } @@ -1659,7 +1659,7 @@ void DrawNodeMethodsTest::drawAll() {70 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y / 2}, {60 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, 60 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y / 2}, {70 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y / 2} }; - drawNodeEx->drawPoints(position, 4, 10 + 2 * sliderValue[sliderType::Thickness], Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position, 4, 10 + 2 * sliderValue[sliderType::Thickness], Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); } break; } @@ -1671,7 +1671,7 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->drawTriangle(Vec2(AXRANDOM_0_1() * 50 + 100, AXRANDOM_0_1() * 50 + 100), Vec2(AXRANDOM_MINUS1_1() * 50, AXRANDOM_MINUS1_1() * 50), Vec2(AXRANDOM_0_1() * 50 + 100, AXRANDOM_0_1() * 50 + 100), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; } @@ -1684,19 +1684,19 @@ void DrawNodeMethodsTest::drawAll() int yy1 = 150; int yy = 0; drawNodeEx->drawSegment(Vec2(-150.0f, yy - yy1), Vec2(200, yy - yy1), 20 + 5 * sliderValue[sliderType::Thickness], - Color4F::GREEN, DrawNodeEx::Round, DrawNodeEx::Round); + Color::GREEN, DrawNodeEx::Round, DrawNodeEx::Round); labelRound->setPosition(Vec2(250.0f, 85)); yy += 170; drawNodeEx->drawSegment(Vec2(-150.0f, yy - yy1), Vec2(200, yy - yy1), 20 + 5 * sliderValue[sliderType::Thickness], - Color4F::BLUE, DrawNodeEx::Square, DrawNodeEx::Square); + Color::BLUE, DrawNodeEx::Square, DrawNodeEx::Square); labelSquare->setPosition(Vec2(250.0f, 170)); yy += 170; drawNodeEx->drawSegment(Vec2(-150.0f, yy - yy1), Vec2(200, yy - yy1), 20 + 5 * sliderValue[sliderType::Thickness], - Color4F::RED, DrawNodeEx::Butt, DrawNodeEx::Butt); + Color::RED, DrawNodeEx::Butt, DrawNodeEx::Butt); labelButt->setPosition(Vec2(250.0f, 255)); break; @@ -1706,11 +1706,11 @@ void DrawNodeMethodsTest::drawAll() for (int i = 100; i > 1; i--) { drawNodeEx->drawSolidCircle(VisibleRect::center(), 3 * i, AX_DEGREES_TO_RADIANS(90), AXRANDOM_0_1() * 20.f + 20.f, 1.0f, 1.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness], Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness], Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); Vec2 pos = Vec2(-100, -100) + Vec2(AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y); drawNodeEx->drawSolidCircle(VisibleRect::center() + pos, AXRANDOM_0_1() * 200, AX_DEGREES_TO_RADIANS(AXRANDOM_MINUS1_1() * 90), 10, 1.0f, 1.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness], Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), sliderValue[sliderType::Thickness], Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } @@ -1719,7 +1719,7 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->drawSolidCircle( Vec2(AXRANDOM_0_1() * -VisibleRect::rightTop().x, -AXRANDOM_0_1() * VisibleRect::rightTop().y), AXRANDOM_0_1() * 40.f + 40.f, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f),); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f),); }*/ break; } @@ -1733,14 +1733,14 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->setDNRotation(rotation / 10.0f); drawNodeEx->setDNScale(Vec2(2.0f, 2.0f)); drawNodeEx->setDNCenter(vertices1[4]); - drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::BLUE); + drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::BLUE); drawNodeEx->setDNRotation(rotation); - drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::YELLOW); + drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::YELLOW); drawNodeEx->setDNRotation(-rotation / 5); - drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::WHITE); + drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::WHITE); drawNodeEx->resetDNValues(); - drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color4F::GREEN); + drawNodeEx->drawSolidPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), Color::GREEN); break; } @@ -1749,7 +1749,7 @@ void DrawNodeMethodsTest::drawAll() for (int i = 0; i < 100; i++) { Vec2 pos = Vec2(-100, -100) + Vec2(AXRANDOM_MINUS1_1() * VisibleRect::rightTop().x, AXRANDOM_MINUS1_1() * VisibleRect::rightTop().y); - drawNodeEx->drawSolidRect(pos, pos + Vec2(20.0f * sliderValue[sliderType::Thickness], 20.0f * sliderValue[sliderType::Thickness]), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f), sliderValue[sliderType::Thickness]); + drawNodeEx->drawSolidRect(pos, pos + Vec2(20.0f * sliderValue[sliderType::Thickness], 20.0f * sliderValue[sliderType::Thickness]), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f), sliderValue[sliderType::Thickness]); } break; @@ -1764,36 +1764,36 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->setDNRotation(rotation + 45); drawNodeEx->setDNCenter(gear1); - drawNodeEx->drawStar(Vec2(gear1), 30, 60, 8, Color4F::BLUE, 4.0); + drawNodeEx->drawStar(Vec2(gear1), 30, 60, 8, Color::BLUE, 4.0); drawNodeEx->setDNRotation(-rotation); drawNodeEx->setDNCenter(gear2); - drawNodeEx->drawStar(gear2, 30, 60, 8, Color4F::GREEN, 4.0); + drawNodeEx->drawStar(gear2, 30, 60, 8, Color::GREEN, 4.0); drawNodeEx->resetDNValues(); - drawNodeEx->drawLine(gear2, gear1, Color4F::RED, sliderValue[sliderType::Thickness]); // line + drawNodeEx->drawLine(gear2, gear1, Color::RED, sliderValue[sliderType::Thickness]); // line drawNodeEx->setDNCenter(gear4); drawNodeEx->setDNRotation(rotation + 45); - drawNodeEx->drawStar(gear3, 30, 60, 18, Color4F::RED, 1.0); - drawNodeEx->drawLine(gear3, gear4, Color4F::YELLOW, sliderValue[sliderType::Thickness]); // line + drawNodeEx->drawStar(gear3, 30, 60, 18, Color::RED, 1.0); + drawNodeEx->drawLine(gear3, gear4, Color::YELLOW, sliderValue[sliderType::Thickness]); // line // drawNodeEx->resetDNValues(); drawNodeEx->setDNRotation(rotation - 45); drawNodeEx->setDNCenter(gear4); - drawNodeEx->drawStar(gear4, 40, 60, 60, Color4F::GREEN, 1.0); + drawNodeEx->drawStar(gear4, 40, 60, 60, Color::GREEN, 1.0); drawNodeEx->setDNRotation(rotation); drawNodeEx->setDNCenter(Vec2(-110, 250)); - drawNodeEx->drawStar(Vec2(-110, 250), 30, 70, 5, Color4F::GREEN, 1.0); + drawNodeEx->drawStar(Vec2(-110, 250), 30, 70, 5, Color::GREEN, 1.0); drawNodeEx->setDNCenter(Vec2(-150, 100)); - drawNodeEx->drawStar(Vec2(-150, 100), 80, 100, 40, Color4F::GREEN, 1.0); + drawNodeEx->drawStar(Vec2(-150, 100), 80, 100, 40, Color::GREEN, 1.0); drawNodeEx->setDNCenter(Vec2(-150, -100)); - drawNodeEx->drawStar(Vec2(-150, -100), 5, 70, 3, Color4F::GREEN, 1.0); + drawNodeEx->drawStar(Vec2(-150, -100), 5, 70, 3, Color::GREEN, 1.0); drawNodeEx->setDNRotation(0); //for (int i = 0; i < 10; i++) //{ // Vec2 pos = Vec2(AXRANDOM_0_1() * VisibleRect::rightTop().x - 100, AXRANDOM_0_1() * VisibleRect::rightTop().y - 300); - // drawNodeEx->drawStar(pos, 40, 60, AXRANDOM_0_1() * 60 + 3, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), sliderValue[sliderType::Thickness])); + // drawNodeEx->drawStar(pos, 40, 60, AXRANDOM_0_1() * 60 + 3, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), sliderValue[sliderType::Thickness])); //} drawNodeEx->setDNRotation(0); @@ -1801,8 +1801,8 @@ void DrawNodeMethodsTest::drawAll() { Vec2 ppp = Vec2(AXRANDOM_MINUS1_1() * size.x / 2, AXRANDOM_MINUS1_1() * size.y / 2); drawNodeEx->setDNPosition(Vec2(ppp)); - drawNodeEx->drawStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), sliderValue[sliderType::Thickness])); - // drawNodeEx->drawSolidStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), sliderValue[sliderType::Thickness])); + // drawNodeEx->drawSolidStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; } @@ -1815,37 +1815,37 @@ void DrawNodeMethodsTest::drawAll() drawNodeEx->setDNRotation(rotation + 45); drawNodeEx->setDNCenter(gear1); - drawNodeEx->drawSolidStar(Vec2(gear1), 30, 60, 8, Color4F::BLUE, Color4F::YELLOW, 4.0); + drawNodeEx->drawSolidStar(Vec2(gear1), 30, 60, 8, Color::BLUE, Color::YELLOW, 4.0); drawNodeEx->setDNRotation(-rotation); drawNodeEx->setDNCenter(gear2); - drawNodeEx->drawSolidStar(gear2, 30, 60, 8, Color4F::GREEN, Color4F::YELLOW, 4.0); + drawNodeEx->drawSolidStar(gear2, 30, 60, 8, Color::GREEN, Color::YELLOW, 4.0); drawNodeEx->resetDNValues(); - drawNodeEx->drawLine(gear2, gear1, Color4F::RED, sliderValue[sliderType::Thickness]); // line + drawNodeEx->drawLine(gear2, gear1, Color::RED, sliderValue[sliderType::Thickness]); // line drawNodeEx->setDNCenter(gear4); drawNodeEx->setDNRotation(rotation + 45); - drawNodeEx->drawSolidStar(gear3, 30, 60, 18, Color4F::RED, Color4F::YELLOW, 1.0); - drawNodeEx->drawLine(gear3, gear4, Color4F::YELLOW, sliderValue[sliderType::Thickness]); // line + drawNodeEx->drawSolidStar(gear3, 30, 60, 18, Color::RED, Color::YELLOW, 1.0); + drawNodeEx->drawLine(gear3, gear4, Color::YELLOW, sliderValue[sliderType::Thickness]); // line drawNodeEx->resetDNValues(); drawNodeEx->setDNRotation(rotation - 45); drawNodeEx->setDNCenter(gear4); - drawNodeEx->drawSolidStar(gear4, 40, 60, 60, Color4F::GREEN, Color4F::YELLOW, 1.0); + drawNodeEx->drawSolidStar(gear4, 40, 60, 60, Color::GREEN, Color::YELLOW, 1.0); drawNodeEx->setDNRotation(rotation); drawNodeEx->setDNCenter(Vec2(-110, 250)); - drawNodeEx->drawSolidStar(Vec2(-110, 250), 30, 70, 5, Color4F::GREEN, Color4F::YELLOW, 1.0); + drawNodeEx->drawSolidStar(Vec2(-110, 250), 30, 70, 5, Color::GREEN, Color::YELLOW, 1.0); drawNodeEx->setDNCenter(Vec2(-150, 100)); - drawNodeEx->drawSolidStar(Vec2(-150, 100), 80, 100, 40, Color4F::GREEN, Color4F::YELLOW, 1.0); + drawNodeEx->drawSolidStar(Vec2(-150, 100), 80, 100, 40, Color::GREEN, Color::YELLOW, 1.0); drawNodeEx->setDNCenter(Vec2(-150, -100)); - drawNodeEx->drawSolidStar(Vec2(-150, -100), 5, 70, 3, Color4F::GREEN, Color4F::YELLOW, 1.0); + drawNodeEx->drawSolidStar(Vec2(-150, -100), 5, 70, 3, Color::GREEN, Color::YELLOW, 1.0); drawNodeEx->setDNRotation(0); for (int i = 0; i < 10; i++) { Vec2 ppp = Vec2(AXRANDOM_MINUS1_1() * size.x / 2, AXRANDOM_MINUS1_1() * size.y / 2); drawNodeEx->setDNPosition(Vec2(ppp)); - drawNodeEx->drawSolidStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawSolidStar(Vec2::ZERO, 40, 60, AXRANDOM_0_1() * 60 + 3, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; @@ -1969,7 +1969,7 @@ void DrawNodePerformaneTest::update(float dt) { drawNodeEx->drawDot(Vec2(100.f + AXRANDOM_0_1() * VisibleRect::rightTop().x, 100.f + AXRANDOM_0_1() * VisibleRect::rightTop().y), - AXRANDOM_0_1() * 20 + 20, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + AXRANDOM_0_1() * 20 + 20, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; } @@ -1978,7 +1978,7 @@ void DrawNodePerformaneTest::update(float dt) for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(i * 7.0f, 50.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } break; } @@ -1992,7 +1992,7 @@ void DrawNodePerformaneTest::update(float dt) {70 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_0_1() * VisibleRect::rightTop().y}, {60 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 60 + AXRANDOM_0_1() * VisibleRect::rightTop().y}, {70 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_0_1() * VisibleRect::rightTop().y} }; - drawNodeEx->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position, 4, 5, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); } break; @@ -2004,7 +2004,7 @@ void DrawNodePerformaneTest::update(float dt) { Vec2 pos = Vec2(AXRANDOM_0_1() * VisibleRect::rightTop().x, AXRANDOM_0_1() * VisibleRect::rightTop().y); drawNodeEx->drawTriangle(pos + Vec2(10.0f, 10.0f), pos + Vec2(70.0f, 30.0f), pos + Vec2(100.0f, 140.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); } break; } @@ -2018,20 +2018,20 @@ void DrawNodePerformaneTest::update(float dt) int yy1 = 0; int yy = 50; drawNodeEx->drawSegment(Vec2(50.0f, yy), Vec2(400, yy - yy1), count / 20, - Color4F::GREEN, DrawNodeEx::Round, DrawNodeEx::Round); + Color::GREEN, DrawNodeEx::Round, DrawNodeEx::Round); label1->setPosition(Vec2(410.0f, yy + 55)); yy += 110; drawNodeEx->drawSegment(Vec2(50.0f, yy), Vec2(400, yy - yy1), count / 20, - Color4F::BLUE, DrawNodeEx::Round, DrawNodeEx::Square); + Color::BLUE, DrawNodeEx::Round, DrawNodeEx::Square); label2->setPosition(Vec2(410.0f, yy)); yy += 110; drawNodeEx->drawSegment(Vec2(50.0f, yy), Vec2(400, yy - yy1), count / 20, - Color4F::RED, DrawNodeEx::Round, DrawNodeEx::Butt); + Color::RED, DrawNodeEx::Round, DrawNodeEx::Butt); label3->setPosition(Vec2(410.0f, yy - 55)); break; @@ -2044,7 +2044,7 @@ void DrawNodePerformaneTest::update(float dt) drawNodeEx->drawSolidCircle( Vec2(AXRANDOM_0_1() * VisibleRect::rightTop().x, AXRANDOM_0_1() * VisibleRect::rightTop().y), AXRANDOM_0_1() * 40.f + 40.f, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); } break; } @@ -2056,7 +2056,7 @@ void DrawNodePerformaneTest::update(float dt) drawNodeEx->setDNRotation(count); // draw->setDNScale(Vec2(count, count)); drawNodeEx->setDNCenter(vertices1[0]); - drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color4F::GREEN, count); + drawNodeEx->drawPoly(vertices1, sizeof(vertices1) / sizeof(vertices1[0]), true, Color::GREEN, count); drawNodeEx->resetDNValues(); break; } @@ -2067,7 +2067,7 @@ void DrawNodePerformaneTest::update(float dt) { Vec2 pos = Vec2(AXRANDOM_0_1() * VisibleRect::rightTop().x, AXRANDOM_0_1() * VisibleRect::rightTop().y); drawNodeEx->drawSolidRect(pos, pos + Vec2(20.0f, 20.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); } break; } @@ -2132,13 +2132,13 @@ void DrawNodeDrawInWrongOrder_Issue1888::update(float dt) {70 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_0_1() * VisibleRect::rightTop().y}, {60 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 60 + AXRANDOM_0_1() * VisibleRect::rightTop().y}, {70 + AXRANDOM_0_1() * VisibleRect::rightTop().x, 70 + AXRANDOM_0_1() * VisibleRect::rightTop().y} }; - drawNodeEx->drawPoints(position1, 4, 10, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position1, 4, 10, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); drawNodeEx->drawSolidRect(Vec2(250, 80), Vec2(400, 220), Color4B::YELLOW); for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(i * 7.0f, 120.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } drawNodeEx->drawLine(Vec2(20, 100), Vec2(450, 220), Color4B::GREEN, 8.0f); drawNodeEx->drawLine(Vec2(200, 100), Vec2(450, 250), Color4B::BLUE, 6.0f); @@ -2244,46 +2244,46 @@ void DrawNodeAxmolTest2::update(float dt) void DrawNodeAxmolTest2::drawAllv1(ax::DrawNode* drawNodeEx) { drawNodeEx->drawPoint(Vec2(size.width / 2 - 120, size.height / 2 - 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); drawNodeEx->drawPoint(Vec2(size.width / 2 + 120, size.height / 2 + 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx 4 small points Vec2 position[] = { Vec2(60, 60), Vec2(70, 70), Vec2(60, 70), Vec2(70, 60) }; - drawNodeEx->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position, 4, 5, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a line - drawNodeEx->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1.0, 0.0, 0.0, 0.5)); + drawNodeEx->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color(1.0, 0.0, 0.0, 0.5)); // drawNodeEx a rectangle - drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color4F(1, 1, 0, 1)); + drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color(1, 1, 0, 1)); drawNodeEx->drawRect(Vec2(15, 30), Vec2(30, 15), Vec2(15, 0), Vec2(0, 15), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a circle drawNodeEx->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, - Color4F(1.0f, 0.0f, 0.0f, 0.5f)); + Color(1.0f, 0.0f, 0.0f, 0.5f)); drawNodeEx->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_DEGREES_TO_RADIANS(90), 30, false, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx some beziers drawNodeEx->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10), Vec2(size.width - 10, size.height - 10), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawQuadBezier(Vec2(0.0f, size.height), Vec2(size.width / 2, size.height / 2), Vec2(size.width, size.height), 50, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), 100, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(Vec2(size.width - 250, 40.0f), Vec2(size.width - 70, 100.0f), Vec2(size.width - 30, 250.0f), Vec2(size.width - 10, size.height - 50), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array = PointArray::create(20); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -2293,7 +2293,7 @@ void DrawNodeAxmolTest2::drawAllv1(ax::DrawNode* drawNodeEx) array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array2 = PointArray::create(20); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); @@ -2301,28 +2301,28 @@ void DrawNodeAxmolTest2::drawAllv1(ax::DrawNode* drawNodeEx) array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); - drawNodeEx->drawCatmullRom(array2, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCatmullRom(array2, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); // open random color poly Vec2 vertices[] = { Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f) }; - drawNodeEx->drawPoly(vertices, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(vertices, 5, false, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // closed random color poly Vec2 vertices2[] = { Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f) }; - drawNodeEx->drawPoly(vertices2, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(vertices2, 3, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx 10 circles for (int i = 0; i < 10; i++) { drawNodeEx->drawDot(Vec2(size.width / 2, size.height / 2), 10.f * (10 - i), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } // drawNodeEx polygons Vec2 points[] = { Vec2(size.height / 4, 0.0f), Vec2(size.width, size.height / 5), Vec2(size.width / 3 * 2, size.height) }; - drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 4, - Color4F(0.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 4, + Color(0.0f, 0.0f, 1.0f, 0.5f)); // star poly (triggers buggs) { @@ -2336,8 +2336,8 @@ void DrawNodeAxmolTest2::drawAllv1(ax::DrawNode* drawNodeEx) // {o -h, o+w}, {o,o}, // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // star poly (doesn't trigger bug... order is important un tesselation is supported. @@ -2356,39 +2356,39 @@ void DrawNodeAxmolTest2::drawAllv1(ax::DrawNode* drawNodeEx) Vec2(o - h, o + w), // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // drawNodeEx a solid polygon Vec2 vertices3[] = { Vec2(60.0f, 160.0f), Vec2(70.0f, 190.0f), Vec2(100.0f, 190.0f), Vec2(90.0f, 160.0f) }; - drawNodeEx->drawSolidPoly(vertices3, 4, Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidPoly(vertices3, 4, Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid rectangle - drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid circle drawNodeEx->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + Color(0.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx segment - drawNodeEx->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color(0.0f, 1.0f, 0.0f, 1.0f)); - drawNodeEx->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color4F(1.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color(1.0f, 0.0f, 1.0f, 0.5f)); // drawNodeEx triangle drawNodeEx->drawTriangle(Vec2(10.0f, 10.0f), Vec2(70.0f, 30.0f), Vec2(100.0f, 140.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(i * 7.0f, 5.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } drawNodeEx->setLineWidth(4); - drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color4F::YELLOW); - drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color4F::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color::YELLOW); } @@ -2398,46 +2398,46 @@ void DrawNodeAxmolTest2::drawAllv2(ax::extension::DrawNodeEx* drawNodeEx, bool d drawNodeEx->drawPoint(Vec2(size.width / 2 - 120, size.height / 2 - 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); drawNodeEx->drawPoint(Vec2(size.width / 2 + 120, size.height / 2 + 120), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx 4 small points Vec2 position[] = { Vec2(60, 60), Vec2(70, 70), Vec2(60, 70), Vec2(70, 60) }; - drawNodeEx->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + drawNodeEx->drawPoints(position, 4, 5, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a line - drawNodeEx->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1.0, 0.0, 0.0, 0.5)); + drawNodeEx->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color(1.0, 0.0, 0.0, 0.5)); // drawNodeEx a rectangle - drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color4F::RED); + drawNodeEx->drawRect(Vec2(23, 23), Vec2(7, 7), Color::RED); drawNodeEx->drawRect(Vec2(15, 30), Vec2(30, 15), Vec2(15, 0), Vec2(0, 15), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // drawNodeEx a circle drawNodeEx->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 30, true, 1.0f, 2.0f, - Color4F(1.0f, 0.0f, 0.0f, 0.5f)); + Color(1.0f, 0.0f, 0.0f, 0.5f)); drawNodeEx->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_DEGREES_TO_RADIANS(90), 30, false, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx some beziers drawNodeEx->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10), Vec2(size.width - 10, size.height - 10), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawQuadBezier(Vec2(0.0f, size.height), Vec2(size.width / 2, size.height / 2), Vec2(size.width, size.height), 50, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), 100, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); drawNodeEx->drawCubicBezier(Vec2(size.width - 250, 40.0f), Vec2(size.width - 70, 100.0f), Vec2(size.width - 30, 250.0f), Vec2(size.width - 10, size.height - 50), 10, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array = PointArray::create(20); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -2447,7 +2447,7 @@ void DrawNodeAxmolTest2::drawAllv2(ax::extension::DrawNodeEx* drawNodeEx, bool d array->addControlPoint(Vec2(80.0f, size.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(size.width / 2, size.height / 2)); - drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCardinalSpline(array, 0.5f, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array2 = PointArray::create(20); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); @@ -2455,28 +2455,28 @@ void DrawNodeAxmolTest2::drawAllv2(ax::extension::DrawNodeEx* drawNodeEx, bool d array2->addControlPoint(Vec2(size.width - 80, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, size.height - 80)); array2->addControlPoint(Vec2(size.width / 2, 30.0f)); - drawNodeEx->drawCatmullRom(array2, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + drawNodeEx->drawCatmullRom(array2, 50, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); // open random color poly Vec2 vertices[] = { Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f) }; - drawNodeEx->drawPoly(vertices, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(vertices, 5, false, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // closed random color poly Vec2 vertices2[] = { Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f) }; - drawNodeEx->drawPoly(vertices2, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + drawNodeEx->drawPoly(vertices2, 3, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // drawNodeEx 10 circles for (int i = 0; i < 10; i++) { drawNodeEx->drawDot(Vec2(size.width / 2, size.height / 2), 10.f * (10 - i), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } // drawNodeEx polygons Vec2 points[] = { Vec2(size.height / 4, 0.0f), Vec2(size.width, size.height / 5), Vec2(size.width / 3 * 2, size.height) }; - drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 4, - Color4F(0.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawPolygon(points, sizeof(points) / sizeof(points[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 4, + Color(0.0f, 0.0f, 1.0f, 0.5f)); // star poly (triggers buggs) { @@ -2490,8 +2490,8 @@ void DrawNodeAxmolTest2::drawAllv2(ax::extension::DrawNodeEx* drawNodeEx, bool d //{o -h, o+w}, {o,o}, // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // star poly (doesn't trigger bug... order is important un tesselation is supported. @@ -2511,39 +2511,39 @@ void DrawNodeAxmolTest2::drawAllv2(ax::extension::DrawNodeEx* drawNodeEx, bool d Vec2(o, o), // left spike }; - drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color4F(1.0f, 0.0f, 0.0f, 0.5f), 1, - Color4F(0.0f, 0.0f, 1.0f, 1.0f)); + drawNodeEx->drawPolygon(star, sizeof(star) / sizeof(star[0]), Color(1.0f, 0.0f, 0.0f, 0.5f), 1, + Color(0.0f, 0.0f, 1.0f, 1.0f)); } // drawNodeEx a solid polygon Vec2 vertices3[] = { Vec2(60.0f, 160.0f), Vec2(70.0f, 190.0f), Vec2(100.0f, 190.0f), Vec2(90.0f, 160.0f) }; - drawNodeEx->drawSolidPoly(vertices3, 4, Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidPoly(vertices3, 4, Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid rectangle - drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color4F(1.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color(1.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx a solid circle drawNodeEx->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, - Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + Color(0.0f, 1.0f, 0.0f, 1.0f)); // drawNodeEx segment - drawNodeEx->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); + drawNodeEx->drawSegment(Vec2(20.0f, size.height), Vec2(20.0f, size.height / 2), 10, Color(0.0f, 1.0f, 0.0f, 1.0f)); - drawNodeEx->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color4F(1.0f, 0.0f, 1.0f, 0.5f)); + drawNodeEx->drawSegment(Vec2(10.0f, size.height / 2), Vec2(size.width / 2, size.height / 2), 40, Color(1.0f, 0.0f, 1.0f, 0.5f)); // drawNodeEx triangle drawNodeEx->drawTriangle(Vec2(10.0f, 10.0f), Vec2(70.0f, 30.0f), Vec2(100.0f, 140.0f), - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); for (int i = 0; i < 100; i++) { drawNodeEx->drawPoint(Vec2(i * 7.0f, 5.0f), (float)i / 5 + 1, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } drawNodeEx->setLineWidth(4); - drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color4F::YELLOW); - drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color4F::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, size.height), Vec2(size.width, size.height - 20), Color::YELLOW); + drawNodeEx->drawLine(Vec2(0.0f, 0.0f), Vec2(size.width, size.height - 20), Color::YELLOW); } string DrawNodeAxmolTest2::title() const @@ -2569,7 +2569,7 @@ DrawNodeCocos2dxBackwardsAPITest::DrawNodeCocos2dxBackwardsAPITest() int y = 0; Vec2 vertices[5]; drawNodeEx->setScale(0.5); - Color4F color; + Color color; for (int iy = 0; iy < 5; iy++) { x = 0; @@ -2584,14 +2584,14 @@ DrawNodeCocos2dxBackwardsAPITest::DrawNodeCocos2dxBackwardsAPITest() if (AXRANDOM_0_1() > 0.5f) { drawNodeEx->setIsConvex(true); - color = Color4F::YELLOW; + color = Color::YELLOW; } else { drawNodeEx->setIsConvex(false); // default value! - color = Color4F::ORANGE; + color = Color::ORANGE; } - drawNodeEx->drawPolygon(vertices, 5, Color4F(0.7f, 0.7f, 0.7f, 0.5f), 1.0f, color); + drawNodeEx->drawPolygon(vertices, 5, Color(0.7f, 0.7f, 0.7f, 0.5f), 1.0f, color); x += 70; } y += 80; @@ -2615,26 +2615,26 @@ DrawNodeIssueTester::DrawNodeIssueTester() drawNodeEx->setDNPosition(Vec2(5, 150)); drawNodeEx->setLineWidth(1); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F::GREEN); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color::GREEN); auto draw = DrawNode::create(); addChild(draw, 10); draw->setPosition(70, 150); - draw->drawPoly(vertices, verticesCount, false, Color4F::BLUE); + draw->drawPoly(vertices, verticesCount, false, Color::BLUE); drawNodeEx->setDNPosition(Vec2(140, 150)); drawNodeEx->setLineWidth(1); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F::RED); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color::RED); drawNodeEx->setDNPosition(Vec2(200, 150)); drawNodeEx->setLineWidth(1); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F::RED, 3); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F::WHITE); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color::RED, 3); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color::WHITE); drawNodeEx->setDNPosition(Vec2(270, 150)); drawNodeEx->setLineWidth(1); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F(0.0f, 0.5f, 0.5f, 0.5f), 10); - drawNodeEx->drawPoly(vertices, verticesCount, false, Color4F::BLACK); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color(0.0f, 0.5f, 0.5f, 0.5f), 10); + drawNodeEx->drawPoly(vertices, verticesCount, false, Color::BLACK); float thick = 0.0f; float y = -90.0f; @@ -2643,7 +2643,7 @@ DrawNodeIssueTester::DrawNodeIssueTester() { thick += 0.5f; y += thick + 1; - drawNodeEx->drawLine(Vec2(140, y), Vec2(180, y), Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), thick); + drawNodeEx->drawLine(Vec2(140, y), Vec2(180, y), Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), thick); } drawNodeEx->drawPie(Vec2(-220, 150), 20, 0, 100, 300, 1, 1, Color4B::TRANSPARENT, Color4B::BLUE, DrawNodeEx::DrawMode::Line, 10); @@ -2651,7 +2651,7 @@ DrawNodeIssueTester::DrawNodeIssueTester() for (int i = 2; i < 30; i++) { drawNodeEx->drawCircle(center, 5 * i, AX_DEGREES_TO_RADIANS(90), i, false, 1.0f, 1.0f, - Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), 0.5f); + Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f), 0.5f); } Vec2* fbHorse = new Vec2[856 / 2]; @@ -2661,7 +2661,7 @@ DrawNodeIssueTester::DrawNodeIssueTester() drawNodeEx->setDNPosition(Vec2(-90, -160)); for (size_t i = 0; i < sizeof(verticesFB) / sizeof(verticesFB[0]); i += 4) { - drawNodeEx->drawLine(Vec2(verticesFB[i] * scale, verticesFB[i + 1] * scale) + pos, Vec2(verticesFB[i + 2] * scale, verticesFB[i + 3] * scale) + pos, Color4F::RED, 0.5f); + drawNodeEx->drawLine(Vec2(verticesFB[i] * scale, verticesFB[i + 1] * scale) + pos, Vec2(verticesFB[i + 2] * scale, verticesFB[i + 3] * scale) + pos, Color::RED, 0.5f); } initRadioButtuns(); @@ -2764,34 +2764,34 @@ void DrawNodeSpLinesTest::update(float dt) int boxSize = 3; for (auto&& p : points) { - drawNodeExCP->drawRect(Vec2(p.x - boxSize, p.y - boxSize), Vec2(p.x + boxSize, p.y + boxSize), Color4F::BLUE); + drawNodeExCP->drawRect(Vec2(p.x - boxSize, p.y - boxSize), Vec2(p.x + boxSize, p.y + boxSize), Color::BLUE); array->addControlPoint(Vec2(p.x, p.y)); } - drawNodeEx->drawCardinalSpline(array, 0.2f, points.size() * 8, Color4F::GREEN, 20.0f); - drawNode->drawCardinalSpline(array, 0.2f, points.size() * 8, Color4F::BLUE); + drawNodeEx->drawCardinalSpline(array, 0.2f, points.size() * 8, Color::GREEN, 20.0f); + drawNode->drawCardinalSpline(array, 0.2f, points.size() * 8, Color::BLUE); - drawNodeEx->drawCardinalSpline(array, 0.2f, points.size() * 16, Color4F(1.0f, 1.0f, 0.5f, 1.0f), 10.0f); + drawNodeEx->drawCardinalSpline(array, 0.2f, points.size() * 16, Color(1.0f, 1.0f, 0.5f, 1.0f), 10.0f); - // drawNodeEx->drawCatmullRom(array, points.size() * 8, Color4F::YELLOW,5); + // drawNodeEx->drawCatmullRom(array, points.size() * 8, Color::YELLOW,5); //if (points.size()>3) //{ // int step = points.size()/4; - // drawNodeEx->drawCubicBezier(points.at(0), points.at(step),points.at(step*2),points.at(points.size()-1), points.size(), Color4F::BLUE); + // drawNodeEx->drawCubicBezier(points.at(0), points.at(step),points.at(step*2),points.at(points.size()-1), points.size(), Color::BLUE); //} - drawNodeEx->drawCardinalSpline(pts, 0.5f, 360, Color4F::RED, 5.0f); - drawNodeEx->drawCardinalSpline(pts2, 0.5f, 360, Color4F::GREEN, 2.0f); + drawNodeEx->drawCardinalSpline(pts, 0.5f, 360, Color::RED, 5.0f); + drawNodeEx->drawCardinalSpline(pts2, 0.5f, 360, Color::GREEN, 2.0f); int i1 = RandomHelper::random_int(0, n - 1); int i2 = RandomHelper::random_int(0, n - 1); - drawNodeEx->drawDot(pts->getControlPointAtIndex(i1), 7, Color4F(0, 1, 0, 0.3)); - drawNodeEx->drawDot(pts->getControlPointAtIndex(i1), 4, Color4F::GREEN); + drawNodeEx->drawDot(pts->getControlPointAtIndex(i1), 7, Color(0, 1, 0, 0.3)); + drawNodeEx->drawDot(pts->getControlPointAtIndex(i1), 4, Color::GREEN); - drawNodeEx->drawDot(pts2->getControlPointAtIndex(i2), 7, Color4F(0, 1, 0, 0.3)); - drawNodeEx->drawDot(pts2->getControlPointAtIndex(i2), 4, Color4F::GREEN); + drawNodeEx->drawDot(pts2->getControlPointAtIndex(i2), 7, Color(0, 1, 0, 0.3)); + drawNodeEx->drawDot(pts2->getControlPointAtIndex(i2), 4, Color::GREEN); } CandyMixEeffect::CandyMixEeffect() @@ -2849,7 +2849,7 @@ void CandyMixEeffect::rotozoom() color = cc; } - // color = Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); + // color = Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f); drawNodeEx->drawPoint(Vec2(px, py), 2, color); o++; } @@ -2862,7 +2862,7 @@ void CandyMixEeffect::rotozoom() centerY = HEIGHT * 0.5 + cos(angle) * zoom * 350; } -void CandyMixEeffect::renderLine(float x1, float x2, float y, ax::Color4F color, float angle) +void CandyMixEeffect::renderLine(float x1, float x2, float y, ax::Color color, float angle) { @@ -2890,7 +2890,7 @@ void CandyMixEeffect::renderLine(float x1, float x2, float y, ax::Color4F color, float rr = MIN(mm, r * sf + sp); float gg = MIN(mm, g * sf + sp); float bb = MIN(mm, b * sf + sp); - drawNodeEx->drawPoint(Vec2(y, x - 50), 2.0f, Color4F(rr, gg, bb, 0.8f)); + drawNodeEx->drawPoint(Vec2(y, x - 50), 2.0f, Color(rr, gg, bb, 0.8f)); } } @@ -2919,13 +2919,13 @@ void CandyMixEeffect::update(float dt) float x3 = xa + sin(rot + (float)M_PI) * rad; float x4 = xa + sin(rot + (float)M_PI * 1.5f) * rad; if (x1 < x2) - renderLine(x1, x2, y, Color4F::RED, rot); + renderLine(x1, x2, y, Color::RED, rot); if (x2 < x3) - renderLine(x2, x3, y, Color4F::GREEN, rot + (float)M_PI * 0.5f); + renderLine(x2, x3, y, Color::GREEN, rot + (float)M_PI * 0.5f); if (x3 < x4) - renderLine(x3, x4, y, Color4F::BLUE, rot + (float)M_PI); + renderLine(x3, x4, y, Color::BLUE, rot + (float)M_PI); if (x4 < x1) - renderLine(x4, x1, y, Color4F::YELLOW, rot + (float)M_PI * 1.5f); + renderLine(x4, x1, y, Color::YELLOW, rot + (float)M_PI * 1.5f); t += sin(ta + ya) * tb; xa += sin(t + ta) * 0.1f; } diff --git a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h index 276473dec93..7e6271aba0f 100644 --- a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h +++ b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h @@ -182,7 +182,7 @@ class DrawNodeMorphTest_SolidPolygon : public DrawNodeExBaseTest ax::Vec2* verticesObj1[10]; ax::Vec2* verticesObj2[10]; ax::Vec2* verticesObjMorph[10]; - ax::Color4F color[10]; + ax::Color color[10]; float rad[10]; bool state[10]; @@ -205,7 +205,7 @@ class DrawNodeMorphTest_Polygon : public DrawNodeExBaseTest ax::Vec2* verticesObj1[10]; ax::Vec2* verticesObj2[10]; ax::Vec2* verticesObjMorph[10]; - ax::Color4F color[10]; + ax::Color color[10]; float rad[10]; bool state[10]; @@ -467,7 +467,7 @@ class CandyMixEeffect : public DrawNodeExBaseTest virtual std::string subtitle() const override; void update(float dt); - void renderLine(float x1, float x2, float y, ax::Color4F color, float angle); + void renderLine(float x1, float x2, float y, ax::Color color, float angle); private: std::vector points; diff --git a/tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.h b/tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.h index ebf9b27bab6..1d47f09ed59 100644 --- a/tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.h +++ b/tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.h @@ -180,7 +180,7 @@ class DrawNodeMorphTest_SolidPolygon : public DrawNodeBaseTest ax::Vec2* verticesObj1[10]; ax::Vec2* verticesObj2[10]; ax::Vec2* verticesObjMorph[10]; - ax::Color4F color[10]; + ax::Color color[10]; float rad[10]; bool state[10]; @@ -203,7 +203,7 @@ class DrawNodeMorphTest_Polygon : public DrawNodeBaseTest ax::Vec2* verticesObj1[10]; ax::Vec2* verticesObj2[10]; ax::Vec2* verticesObjMorph[10]; - ax::Color4F color[10]; + ax::Color color[10]; float rad[10]; bool state[10]; @@ -424,7 +424,7 @@ class CandyMixEeffect : public DrawNodeBaseTest virtual std::string subtitle() const override; void update(float dt); - void renderLine(float x1, float x2, float y, ax::Color4F color, float angle); + void renderLine(float x1, float x2, float y, ax::Color color, float angle); private: std::vector points; diff --git a/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp index 236f0f84602..8fe6637e07b 100644 --- a/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp @@ -239,8 +239,8 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto s = Director::getInstance()->getWinSize(); auto drawNode = DrawNode::create(); - drawNode->drawLine(Vec2(0.0f, s.height / 2), Vec2(s.width, s.height / 2), Color4F(1.0f, 1.0f, 1.0f, 1.0f)); - drawNode->drawLine(Vec2(s.width / 2, 0.0f), Vec2(s.width / 2, s.height), Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + drawNode->drawLine(Vec2(0.0f, s.height / 2), Vec2(s.width, s.height / 2), Color(1.0f, 1.0f, 1.0f, 1.0f)); + drawNode->drawLine(Vec2(s.width / 2, 0.0f), Vec2(s.width / 2, s.height), Color(1.0f, 1.0f, 1.0f, 1.0f)); addChild(drawNode, -1); // Upper Label @@ -944,7 +944,7 @@ LabelFNTBounds::LabelFNTBounds() Vec2 vertices[4] = {Vec2(origin.width, origin.height), Vec2(labelSize.width + origin.width, origin.height), Vec2(labelSize.width + origin.width, labelSize.height + origin.height), Vec2(origin.width, labelSize.height + origin.height)}; - drawNode->drawPoly(vertices, 4, true, Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color(1.0f, 1.0f, 1.0f, 1.0f)); addChild(drawNode); } @@ -1134,9 +1134,9 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() drawNode->setAnchorPoint(Vec2(0, 0)); this->addChild(drawNode); drawNode->drawSegment(Vec2(size.width * 0.1f, size.height * 0.8f), Vec2(size.width * 0.1, 0.0f), 1, - Color4F(1.0f, 0.0f, 0.0f, 1.0f)); + Color(1.0f, 0.0f, 0.0f, 1.0f)); drawNode->drawSegment(Vec2(size.width * 0.85f, size.height * 0.8f), Vec2(size.width * 0.85f, 0.0f), 1, - Color4F(1.0f, 0.0f, 0.0f, 1.0f)); + Color(1.0f, 0.0f, 0.0f, 1.0f)); TTFConfig ttfConfig("fonts/HKYuanMini.ttf", 25, GlyphCollection::DYNAMIC); auto label1 = Label::createWithTTF(ttfConfig, "你好,Axmol Label.", TextHAlignment::LEFT, size.width * 0.75f); @@ -1302,7 +1302,7 @@ LabelTTFDistanceField::LabelTTFDistanceField() borderDraw->clear(); Vec2 vertices[4] = {Vec2::ZERO, Vec2(labelContentSize.width, 0.0f), Vec2(labelContentSize.width, labelContentSize.height), Vec2(0.0f, labelContentSize.height)}; - borderDraw->drawPoly(vertices, 4, true, Color4F::RED); + borderDraw->drawPoly(vertices, 4, true, Color::RED); auto label2 = Label::createWithTTF(ttfConfig, "Distance Field", TextHAlignment::CENTER, size.width); label2->setPosition(Vec2(size.width / 2, size.height * 0.3f)); @@ -1316,7 +1316,7 @@ LabelTTFDistanceField::LabelTTFDistanceField() borderDraw2->clear(); Vec2 vertices2[4] = {Vec2::ZERO, Vec2(labelContentSize2.width, 0.0f), Vec2(labelContentSize2.width, labelContentSize2.height), Vec2(0.0f, labelContentSize2.height)}; - borderDraw2->drawPoly(vertices2, 4, true, Color4F::GREEN); + borderDraw2->drawPoly(vertices2, 4, true, Color::GREEN); } std::string LabelTTFDistanceField::title() const @@ -1622,7 +1622,7 @@ LabelTTFOldNew::LabelTTFOldNew() Vec2 vertices[4] = {Vec2(origin.width, origin.height), Vec2(labelSize.width + origin.width, origin.height), Vec2(labelSize.width + origin.width, labelSize.height + origin.height), Vec2(origin.width, labelSize.height + origin.height)}; - drawNode->drawPoly(vertices, 4, true, Color4F(1.0f, 0.0f, 0.0f, 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color(1.0f, 0.0f, 0.0f, 1.0f)); labelSize = label2->getContentSize(); origin = Director::getInstance()->getWinSize(); @@ -1633,7 +1633,7 @@ LabelTTFOldNew::LabelTTFOldNew() Vec2 vertices2[4] = {Vec2(origin.width, origin.height), Vec2(labelSize.width + origin.width, origin.height), Vec2(labelSize.width + origin.width, labelSize.height + origin.height), Vec2(origin.width, labelSize.height + origin.height)}; - drawNode->drawPoly(vertices2, 4, true, Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + drawNode->drawPoly(vertices2, 4, true, Color(1.0f, 1.0f, 1.0f, 1.0f)); addChild(drawNode); } @@ -2111,7 +2111,7 @@ LabelIssue12409Test::LabelIssue12409Test() Vec2(labelOrigin.x, labelOrigin.y + labelSize.height)}; auto drawNode = DrawNode::create(); - drawNode->drawPoly(vertices, 4, true, Color4F::WHITE); + drawNode->drawPoly(vertices, 4, true, Color::WHITE); addChild(drawNode); } @@ -2538,10 +2538,10 @@ void LabelLayoutBaseTest::updateDrawNodeSize(const ax::Size& drawNodeSize) Vec2(drawNodeSize.width + origin.width, drawNodeSize.height + origin.height), Vec2(origin.width, drawNodeSize.height + origin.height)}; _drawNode->clear(); - _drawNode->drawLine(vertices[0], vertices[1], Color4F(1.0f, 1.0f, 1.0f, 1.0f)); - _drawNode->drawLine(vertices[0], vertices[3], Color4F(1.0f, 1.0f, 1.0f, 1.0f)); - _drawNode->drawLine(vertices[2], vertices[3], Color4F(1.0f, 1.0f, 1.0f, 1.0f)); - _drawNode->drawLine(vertices[1], vertices[2], Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + _drawNode->drawLine(vertices[0], vertices[1], Color(1.0f, 1.0f, 1.0f, 1.0f)); + _drawNode->drawLine(vertices[0], vertices[3], Color(1.0f, 1.0f, 1.0f, 1.0f)); + _drawNode->drawLine(vertices[2], vertices[3], Color(1.0f, 1.0f, 1.0f, 1.0f)); + _drawNode->drawLine(vertices[1], vertices[2], Color(1.0f, 1.0f, 1.0f, 1.0f)); } LabelWrapByWordTest::LabelWrapByWordTest() diff --git a/tests/cpp-tests/Source/LayerTest/LayerTest.cpp b/tests/cpp-tests/Source/LayerTest/LayerTest.cpp index d89e55161d4..d3c1844c6e4 100644 --- a/tests/cpp-tests/Source/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Source/LayerTest/LayerTest.cpp @@ -838,7 +838,7 @@ void LayerRadialGradientTest::onEnter() _currentSeletedItemIndex = 0; auto director = Director::getInstance(); - director->setClearColor(Color4F(0, 0, 0, 0)); + director->setClearColor(Color(0, 0, 0, 0)); auto origin = director->getVisibleOrigin(); auto size = director->getVisibleSize(); Vec2 center(origin.x + size.width / 2 + 50, origin.y + size.height / 2); diff --git a/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.cpp b/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.cpp index d860b2486c8..e620a18fe62 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.cpp +++ b/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.cpp @@ -142,7 +142,7 @@ void DrawNode3D::updateCommand(ax::Renderer* renderer, const Mat4& transform, ui AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); } -void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color) +void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color& color) { unsigned int vertex_count = 2; ensureCapacity(vertex_count); @@ -153,7 +153,7 @@ void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color _isDirty = true; } -void DrawNode3D::drawCube(Vec3* vertices, const Color4F& color) +void DrawNode3D::drawCube(Vec3* vertices, const Color& color) { // front face drawLine(vertices[0], vertices[1], color); diff --git a/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.h b/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.h index 4ebf81b759e..092b8353d52 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.h +++ b/tests/cpp-tests/Source/MeshRendererTest/DrawNode3D.h @@ -43,7 +43,7 @@ class DrawNode3D : public ax::Node /** * Draw 3D Line */ - void drawLine(const ax::Vec3& from, const ax::Vec3& to, const Color4F& color); + void drawLine(const ax::Vec3& from, const ax::Vec3& to, const Color& color); /** * Draw 3D cube @@ -58,7 +58,7 @@ class DrawNode3D : public ax::Node * vertices[7]:Left-top-back. * @param color */ - void drawCube(ax::Vec3* vertices, const Color4F& color); + void drawCube(ax::Vec3* vertices, const Color& color); /** Clear the geometry in the node's buffer. */ void clear(); diff --git a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp index 67582224e2f..209501d39fd 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp @@ -1657,7 +1657,7 @@ void MeshRendererWithOBBPerformanceTest::update(float dt) Vec3 corners[8] = {}; _obbt.getCorners(corners); - _drawDebug->drawCube(corners, Color4F(0, 0, 1, 1)); + _drawDebug->drawCube(corners, Color(0, 0, 1, 1)); } if (_obb.size() > 0) { @@ -1667,7 +1667,7 @@ void MeshRendererWithOBBPerformanceTest::update(float dt) { Vec3 corners[8] = {}; _obb[i].getCorners(corners); - _drawOBB->drawCube(corners, _obbt.intersects(_obb[i]) ? Color4F(1, 0, 0, 1) : Color4F(0, 1, 0, 1)); + _drawOBB->drawCube(corners, _obbt.intersects(_obb[i]) ? Color(1, 0, 0, 1) : Color(0, 1, 0, 1)); } } } @@ -2558,7 +2558,7 @@ void CameraBackgroundClearTest::switch_CameraClearMode(ax::Object* sender) } else if (type == CameraBackgroundBrush::BrushType::DEPTH) { - _camera->setBackgroundBrush(CameraBackgroundBrush::createColorBrush(Color4F(1.f, 0.f, 0.f, 1.f), 1.f)); + _camera->setBackgroundBrush(CameraBackgroundBrush::createColorBrush(Color(1.f, 0.f, 0.f, 1.f), 1.f)); _label->setString("Color Clear Brush"); } else if (type == CameraBackgroundBrush::BrushType::COLOR) diff --git a/tests/cpp-tests/Source/MultiTouchTest/MultiTouchTest.cpp b/tests/cpp-tests/Source/MultiTouchTest/MultiTouchTest.cpp index 4c79536d956..342bdcead23 100644 --- a/tests/cpp-tests/Source/MultiTouchTest/MultiTouchTest.cpp +++ b/tests/cpp-tests/Source/MultiTouchTest/MultiTouchTest.cpp @@ -41,7 +41,7 @@ class TouchPoint : public Node { DrawNode* drawNode = DrawNode::create(); auto s = Director::getInstance()->getWinSize(); - Color4F color(touchColor.r / 255.0f, touchColor.g / 255.0f, touchColor.b / 255.0f, 1.0f); + Color color(touchColor.r / 255.0f, touchColor.g / 255.0f, touchColor.b / 255.0f, 1.0f); drawNode->drawLine(Vec2(0.0f, touchPoint.y), Vec2(s.width, touchPoint.y), color); drawNode->drawLine(Vec2(touchPoint.x, 0.0f), Vec2(touchPoint.x, s.height), color); drawNode->drawDot(touchPoint, 3, color); diff --git a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp index 4f120596807..91f0caf201a 100644 --- a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp @@ -258,7 +258,7 @@ NewClippingNodeTest::NewClippingNodeTest() // rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height); // rectangle[3] = Vec2(0, clipper->getContentSize().height); // - // Color4F white(1, 1, 1, 1); + // Color white(1, 1, 1, 1); // stencil->drawPolygon(rectangle, 4, white, 1, white); // clipper->setStencil(stencil); @@ -343,7 +343,7 @@ NewDrawNodeTest::NewDrawNodeTest() rectangle[2] = Vec2(50, 50); rectangle[3] = Vec2(-50, 50); - Color4F white(1, 1, 1, 1); + Color white(1, 1, 1, 1); rectNode->drawPolygon(rectangle, 4, white, 1, white); parent->addChild(rectNode); } diff --git a/tests/cpp-tests/Source/NodeTest/NodeTest.cpp b/tests/cpp-tests/Source/NodeTest/NodeTest.cpp index e2b48d486e7..bce6290e942 100644 --- a/tests/cpp-tests/Source/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Source/NodeTest/NodeTest.cpp @@ -1500,9 +1500,9 @@ void Issue16735Test::onEnter() auto d = DrawNode::create(); d->drawLine(Vec2(origin.x, origin.y + visibleSize.height / 2), - Vec2(origin.x + visibleSize.width, origin.y + visibleSize.height / 2), Color4F::RED); + Vec2(origin.x + visibleSize.width, origin.y + visibleSize.height / 2), Color::RED); d->drawLine(Vec2(origin.x + visibleSize.width / 2, origin.y), - Vec2(origin.x + visibleSize.width / 2, origin.y + visibleSize.height), Color4F::RED); + Vec2(origin.x + visibleSize.width / 2, origin.y + visibleSize.height), Color::RED); addChild(d); } diff --git a/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp index b30d6f75cdf..f2a419e7179 100644 --- a/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp @@ -236,16 +236,16 @@ void DemoBigFlower::onEnter() _emitter->setEndSpinVar(0); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -320,16 +320,16 @@ void DemoRotFlower::onEnter() _emitter->setEndSpinVar(2000); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -472,13 +472,13 @@ void DemoSnow::onEnter() _emitter->setSpeed(130); _emitter->setSpeedVar(30); - Color4F startColor = _emitter->getStartColor(); + Color startColor = _emitter->getStartColor(); startColor.r = 0.9f; startColor.g = 0.9f; startColor.b = 0.9f; _emitter->setStartColor(startColor); - Color4F startColorVar = _emitter->getStartColorVar(); + Color startColorVar = _emitter->getStartColorVar(); startColorVar.b = 0.1f; _emitter->setStartColorVar(startColorVar); @@ -574,16 +574,16 @@ void DemoModernArt::onEnter() _emitter->setEmissionRate(_emitter->getTotalParticles() / _emitter->getLife()); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -1776,8 +1776,8 @@ void DemoEmissionShapeAlphaMask::onEnter() _emitter->setSpeed(0); _emitter->setSpeedVar(0); - _emitter->setStartColor(Color4F::WHITE); - _emitter->setEndColor(Color4F::WHITE); + _emitter->setStartColor(Color::WHITE); + _emitter->setEndColor(Color::WHITE); _emitter->setStartSize(6); _emitter->setEndSize(3); @@ -1853,16 +1853,16 @@ void RadiusMode1::onEnter() _emitter->setEndSpinVar(0); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -1936,16 +1936,16 @@ void RadiusMode2::onEnter() _emitter->setEndSpinVar(0); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -2019,16 +2019,16 @@ void Issue704::onEnter() _emitter->setEndSpinVar(0); // color of particles - Color4F startColor(0.5f, 0.5f, 0.5f, 1.0f); + Color startColor(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColor(startColor); - Color4F startColorVar(0.5f, 0.5f, 0.5f, 1.0f); + Color startColorVar(0.5f, 0.5f, 0.5f, 1.0f); _emitter->setStartColorVar(startColorVar); - Color4F endColor(0.1f, 0.1f, 0.1f, 0.2f); + Color endColor(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColor(endColor); - Color4F endColorVar(0.1f, 0.1f, 0.1f, 0.2f); + Color endColorVar(0.1f, 0.1f, 0.1f, 0.2f); _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -2405,11 +2405,11 @@ void ParticleBatchMultipleEmitters::onEnter() _background = nullptr; auto emitter1 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter1->setStartColor(Color4F(1, 0, 0, 1)); + emitter1->setStartColor(Color(1, 0, 0, 1)); auto emitter2 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter2->setStartColor(Color4F(0, 1, 0, 1)); + emitter2->setStartColor(Color(0, 1, 0, 1)); auto emitter3 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter3->setStartColor(Color4F(0, 0, 1, 1)); + emitter3->setStartColor(Color(0, 0, 1, 1)); auto s = Director::getInstance()->getWinSize(); @@ -2457,13 +2457,13 @@ void ParticleReorder::onEnter() auto parent = (i == 0 ? parent1 : parent2); auto emitter1 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter1->setStartColor(Color4F(1, 0, 0, 1)); + emitter1->setStartColor(Color(1, 0, 0, 1)); emitter1->setBlendAdditive(false); auto emitter2 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter2->setStartColor(Color4F(0, 1, 0, 1)); + emitter2->setStartColor(Color(0, 1, 0, 1)); emitter2->setBlendAdditive(false); auto emitter3 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter3->setStartColor(Color4F(0, 0, 1, 1)); + emitter3->setStartColor(Color(0, 0, 1, 1)); emitter3->setBlendAdditive(false); auto s = Director::getInstance()->getWinSize(); @@ -2586,8 +2586,8 @@ bool RainbowEffect::initWithTotalParticles(int numberOfParticles) setEmissionRate(getTotalParticles() / getLife()); // color of particles - setStartColor(Color4F(Color4B(50, 50, 50, 50))); - setEndColor(Color4F(Color4B(0, 0, 0, 0))); + setStartColor(Color(Color4B(50, 50, 50, 50))); + setEndColor(Color(Color4B(0, 0, 0, 0))); _startColorVar.r = 0.0f; _startColorVar.g = 0.0f; @@ -2900,16 +2900,16 @@ void ReorderParticleSystems::onEnter() // color of particles float color[3] = {0, 0, 0}; color[i] = 1; - Color4F startColor(color[0], color[1], color[2], 1.0f); + Color startColor(color[0], color[1], color[2], 1.0f); particleSystem->setStartColor(startColor); - Color4F startColorVar(0, 0, 0, 0); + Color startColorVar(0, 0, 0, 0); particleSystem->setStartColorVar(startColorVar); - Color4F endColor = startColor; + Color endColor = startColor; particleSystem->setEndColor(endColor); - Color4F endColorVar = startColorVar; + Color endColorVar = startColorVar; particleSystem->setEndColorVar(endColorVar); // size, in pixels @@ -3019,10 +3019,10 @@ void PremultipliedAlphaTest::onEnter() // Toggle next line to see old behavior // this->emitter.opacityModifyRGB = NO; - _emitter->setStartColor(Color4F(1.0f, 1.0f, 1.0f, 1.0f)); - _emitter->setEndColor(Color4F(1.0f, 1.0f, 1.0f, 0.0f)); - _emitter->setStartColorVar(Color4F(0.0f, 0.0f, 0.0f, 0.0f)); - _emitter->setEndColorVar(Color4F(0.0f, 0.0f, 0.0f, 0.0f)); + _emitter->setStartColor(Color(1.0f, 1.0f, 1.0f, 1.0f)); + _emitter->setEndColor(Color(1.0f, 1.0f, 1.0f, 0.0f)); + _emitter->setStartColorVar(Color(0.0f, 0.0f, 0.0f, 0.0f)); + _emitter->setEndColorVar(Color(0.0f, 0.0f, 0.0f, 0.0f)); this->addChild(_emitter, 10); _hasEmitter = true; diff --git a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp index d63ba2bedaa..a4d76b73264 100644 --- a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp @@ -58,7 +58,7 @@ PhysicsTests::PhysicsTests() namespace { -Color4F STATIC_COLOR(1.0f, 0.0f, 0.0f, 1.0f); +Color STATIC_COLOR(1.0f, 0.0f, 0.0f, 1.0f); const int DRAG_BODYS_TAG = 0x80; } // namespace @@ -548,7 +548,7 @@ void PhysicsDemoRayCast::update(float /*delta*/) if (point2 != point3) { - _node->drawDot(point3, 2, Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + _node->drawDot(point3, 2, Color(1.0f, 1.0f, 1.0f, 1.0f)); } addChild(_node); @@ -574,7 +574,7 @@ void PhysicsDemoRayCast::update(float /*delta*/) if (point2 != point3) { - _node->drawDot(point3, 2, Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + _node->drawDot(point3, 2, Color(1.0f, 1.0f, 1.0f, 1.0f)); } addChild(_node); @@ -602,7 +602,7 @@ void PhysicsDemoRayCast::update(float /*delta*/) for (int i = 0; i < num; ++i) { - _node->drawDot(points[i], 2, Color4F(1.0f, 1.0f, 1.0f, 1.0f)); + _node->drawDot(points[i], 2, Color(1.0f, 1.0f, 1.0f, 1.0f)); } addChild(_node); diff --git a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp index b50331425ae..b0164bde0c6 100644 --- a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp @@ -622,7 +622,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() /* add the sprites to the render texture */ renderTexture->addChild(sprite1); renderTexture->addChild(sprite2); - renderTexture->setClearColor(Color4F(0, 0, 0, 0)); + renderTexture->setClearColor(Color(0, 0, 0, 0)); renderTexture->setClearFlags(ClearFlag::COLOR); /* add the render texture to the scene */ @@ -650,7 +650,7 @@ void RenderTextureTargetNode::touched(Object* sender) else { renderTexture->setClearFlags(ClearFlag::NONE); - renderTexture->setClearColor(Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); + renderTexture->setClearColor(Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); } } diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp index 1697d47f6a9..2f973f5f9a2 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp @@ -413,7 +413,7 @@ class EffectNormalMapped : public Effect } void setKBump(float value); void setLightPos(const Vec3& pos); - void setLightColor(const Color4F& color); + void setLightColor(const Color& color); float getKBump() const { return _kBump; } protected: @@ -422,7 +422,7 @@ class EffectNormalMapped : public Effect virtual void setTarget(EffectSprite* sprite) override; EffectSprite* _sprite; Vec3 _lightPos; - Color4F _lightColor; + Color _lightColor; float _kBump; }; @@ -457,7 +457,7 @@ void EffectNormalMapped::setLightPos(const Vec3& pos) SET_UNIFORM(_programState, "u_lightPosInLocalSpace", Vec4(_lightPos.x, _lightPos.y, _lightPos.z, 1)); } -void EffectNormalMapped::setLightColor(const Color4F& color) +void EffectNormalMapped::setLightColor(const Color& color) { _lightColor = color; SET_UNIFORM(_programState, "u_diffuseL", Vec3(_lightColor.r, _lightColor.g, _lightColor.b)); @@ -552,7 +552,7 @@ bool EffectSpriteLamp::init() Mat4 mat = _sprite->getNodeToWorldTransform(); Point lightPosInLocalSpace = PointApplyAffineTransform(Vec2(pos.x, pos.y), _sprite->getWorldToNodeAffineTransform()); - lampEffect->setLightColor(Color4F(1, 1, 1, 1)); + lampEffect->setLightColor(Color(1, 1, 1, 1)); lampEffect->setLightPos(Vec3(lightPosInLocalSpace.x, lightPosInLocalSpace.y, 50.0f)); lampEffect->setKBump(2); _sprite->setEffect(lampEffect); diff --git a/tests/cpp-tests/Source/SpineTest/SpineTest.cpp b/tests/cpp-tests/Source/SpineTest/SpineTest.cpp index 914c9ed70f0..a54c9dfe4f1 100644 --- a/tests/cpp-tests/Source/SpineTest/SpineTest.cpp +++ b/tests/cpp-tests/Source/SpineTest/SpineTest.cpp @@ -460,7 +460,7 @@ bool SkeletonRendererSeparatorExample::init() rect[1] = Vec2(40, 0); rect[2] = Vec2(40, 200); rect[3] = Vec2(0, 200); - betweenNode->drawPolygon(rect, 4, Color4F(1, 0, 0, 1), 1, Color4F(1, 0, 0, 1)); + betweenNode->drawPolygon(rect, 4, ax::Color(1, 0, 0, 1), 1, ax::Color(1, 0, 0, 1)); betweenNode->setPosition(Vec2(_contentSize.width / 2 + 30, 20)); // Spineboy's front, doesn't manage any skeleton, animation or GPU resources, but simply // renders the back slots of Spineboy. The skeleton, animatio state and GPU resources diff --git a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp index 33f9800f9f3..4512a023bac 100644 --- a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp +++ b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp @@ -61,12 +61,12 @@ SpritePolygonTestCase::~SpritePolygonTestCase() void SpritePolygonTestCase::onEnter() { TestCase::onEnter(); - Director::getInstance()->setClearColor(Color4F(102.0f / 255.0f, 184.0f / 255.0f, 204.0f / 255.0f, 1.0f)); + Director::getInstance()->setClearColor(Color(102.0f / 255.0f, 184.0f / 255.0f, 204.0f / 255.0f, 1.0f)); } void SpritePolygonTestCase::onExit() { - Director::getInstance()->setClearColor(Color4F::BLACK); + Director::getInstance()->setClearColor(Color::BLACK); TestCase::onExit(); } @@ -131,15 +131,15 @@ void SpritePolygonTestCase::updateDrawNode() // draw 3 lines Vec3 from = verts[indices[i * 3]].position; Vec3 to = verts[indices[i * 3 + 1]].position; - drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::BLUE); + drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color::BLUE); from = verts[indices[i * 3 + 1]].position; to = verts[indices[i * 3 + 2]].position; - drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::GREEN); + drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color::GREEN); from = verts[indices[i * 3 + 2]].position; to = verts[indices[i * 3]].position; - drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::RED); + drawnode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color::RED); } } } diff --git a/tests/cpp-tests/Source/TileMapTest/TileMapTest2.cpp b/tests/cpp-tests/Source/TileMapTest/TileMapTest2.cpp index ad84f3221ed..90496496cab 100644 --- a/tests/cpp-tests/Source/TileMapTest/TileMapTest2.cpp +++ b/tests/cpp-tests/Source/TileMapTest/TileMapTest2.cpp @@ -659,7 +659,7 @@ TMXOrthoObjectsTestNew::TMXOrthoObjectsTestNew() AXLOGD("{}", objectsVal.getDescription()); auto drawNode = DrawNode::create(); - Color4F color(1.0, 1.0, 1.0, 1.0); + Color color(1.0, 1.0, 1.0, 1.0); for (auto&& obj : objects) { ValueMap& dict = obj.asValueMap(); @@ -709,7 +709,7 @@ TMXIsoObjectsTestNew::TMXIsoObjectsTestNew() AXLOGD("{}", objectsVal.getDescription()); auto drawNode = DrawNode::create(); - Color4F color(1.0, 1.0, 1.0, 1.0); + Color color(1.0, 1.0, 1.0, 1.0); for (auto&& obj : objects) { ValueMap& dict = obj.asValueMap(); @@ -1338,7 +1338,7 @@ TMXGIDObjectsTestNew::TMXGIDObjectsTestNew() AXLOGD("----> Iterating over all the group objects"); auto drawNode = DrawNode::create(); - Color4F color(1.0, 1.0, 1.0, 1.0); + Color color(1.0, 1.0, 1.0, 1.0); auto group = map->getObjectGroup("Object Layer 1"); auto objects = group->getObjects(); for (auto&& obj : objects) diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 727e2777f84..19f28601fdd 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -680,12 +680,12 @@ bool UIListViewTest_ScrollToItem::init() if (getListViewDirection() == ScrollView::Direction::HORIZONTAL) { float halfY = 110; - pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color(0, 0, 0, 1), 2.0f); } else { float halfX = 150; - pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color(0, 0, 0, 1), 2.0f); } _uiLayer->addChild(pNode); } @@ -751,12 +751,12 @@ bool UIListViewTest_Magnetic::init() if (getListViewDirection() == ScrollView::Direction::HORIZONTAL) { float halfY = 110; - pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color(0, 0, 0, 1), 2.0f); } else { float halfX = 150; - pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color(0, 0, 0, 1), 2.0f); } _uiLayer->addChild(pNode); } @@ -908,12 +908,12 @@ bool UIListViewTest_Padding::init() if (getListViewDirection() == ScrollView::Direction::HORIZONTAL) { float halfY = 110; - pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x, center.y - halfY), Vec2(center.x, center.y + halfY), Color(0, 0, 0, 1), 2.0f); } else { float halfX = 150; - pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color4F(0, 0, 0, 1), 2.0f); + pNode->drawLine(Vec2(center.x - halfX, center.y), Vec2(center.x + halfX, center.y), Color(0, 0, 0, 1), 2.0f); } _uiLayer->addChild(pNode); } diff --git a/tests/fairygui-tests/Source/AppDelegate.cpp b/tests/fairygui-tests/Source/AppDelegate.cpp index 1a1d4338487..6ff0876eacb 100644 --- a/tests/fairygui-tests/Source/AppDelegate.cpp +++ b/tests/fairygui-tests/Source/AppDelegate.cpp @@ -74,7 +74,7 @@ bool AppDelegate::applicationDidFinishLaunching() { director->setContentScaleFactor(MIN(smallResolutionSize.height / designResolutionSize.height, smallResolutionSize.width / designResolutionSize.width)); }*/ - director->setClearColor(Color4F(Color4B(0x36, 0x3B, 0x44, 0xFF))); + director->setClearColor(Color(Color4B(0x36, 0x3B, 0x44, 0xFF))); register_all_packages(); diff --git a/tests/fairygui-tests/Source/BasicsScene.cpp b/tests/fairygui-tests/Source/BasicsScene.cpp index 3c31c4d7458..21590b5a79d 100644 --- a/tests/fairygui-tests/Source/BasicsScene.cpp +++ b/tests/fairygui-tests/Source/BasicsScene.cpp @@ -186,7 +186,7 @@ void BasicsScene::playDepth() startPos.x += 10; startPos.y += 10; graph->setPosition(startPos.x, startPos.y); - graph->drawRect(150, 150, 1, Color4F::BLACK, Color4F::RED); + graph->drawRect(150, 150, 1, Color::BLACK, Color::RED); obj->getChild("n22")->as()->addChild(graph); }, EventTag(this)); //avoid duplicate register @@ -196,7 +196,7 @@ void BasicsScene::playDepth() startPos.x += 10; startPos.y += 10; graph->setPosition(startPos.x, startPos.y); - graph->drawRect(150, 150, 1, Color4F::BLACK, Color4F::GREEN); + graph->drawRect(150, 150, 1, Color::BLACK, Color::GREEN); graph->setSortingOrder(200); obj->getChild("n22")->as()->addChild(graph); }, diff --git a/tests/live2d-tests/Source/LAppView.cpp b/tests/live2d-tests/Source/LAppView.cpp index d82aa0736b8..c60f110f667 100644 --- a/tests/live2d-tests/Source/LAppView.cpp +++ b/tests/live2d-tests/Source/LAppView.cpp @@ -218,8 +218,8 @@ void LAppView::setDebugRectsNode(DrawNode* debugRects) void LAppView::drawDebugRects(LAppLive2DManager* manager) const { - const Color4F hitAreaColor = Color4F(1.0f, 0, 0, 0.2f); - const Color4F userDataAreaColor = Color4F(0, 0, 1.0f, 0.2f); + const Color hitAreaColor = Color(1.0f, 0, 0, 0.2f); + const Color userDataAreaColor = Color(0, 0, 1.0f, 0.2f); CubismMatrix44 projection; const Size window = Director::getInstance()->getWinSize(); diff --git a/tests/lua-tests/Source/lua_test_bindings.cpp b/tests/lua-tests/Source/lua_test_bindings.cpp index 4290fa83052..4614a3f62e0 100644 --- a/tests/lua-tests/Source/lua_test_bindings.cpp +++ b/tests/lua-tests/Source/lua_test_bindings.cpp @@ -41,7 +41,7 @@ class DrawNode3D : public Node /** * Draw 3D Line */ - void drawLine(const Vec3& from, const Vec3& to, const Color4F& color); + void drawLine(const Vec3& from, const Vec3& to, const Color& color); /** * Draw 3D cube @@ -56,7 +56,7 @@ class DrawNode3D : public Node * vertices[7]:Left-top-back. * @param color */ - void drawCube(Vec3* vertices, const Color4F& color); + void drawCube(Vec3* vertices, const Color& color); /** Clear the geometry in the node's buffer. */ void clear(); @@ -223,7 +223,7 @@ void DrawNode3D::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) } } -void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color) +void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color& color) { unsigned int vertex_count = 2; ensureCapacity(vertex_count); @@ -239,7 +239,7 @@ void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color _dirty = true; } -void DrawNode3D::drawCube(Vec3* vertices, const Color4F& color) +void DrawNode3D::drawCube(Vec3* vertices, const Color& color) { // front face drawLine(vertices[0], vertices[1], color); @@ -459,7 +459,7 @@ int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L) { ax::Vec3 arg0; ax::Vec3 arg1; - ax::Color4F arg2; + ax::Color arg2; ok &= luaval_to_vec3(L, 2, &arg0, "ax.DrawNode3D:drawLine"); @@ -555,7 +555,7 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L) if (argc == 2) { std::vector arg0; - ax::Color4F arg1; + ax::Color arg1; Vec3 vec3; #if _AX_DEBUG >= 1 if (!tolua_istable(L, 2, 0, &tolua_err))