MCPcopy Create free account
hub / github.com/axmolengine/axmol / drawAll

Method drawAll

tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.cpp:2709–3224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2707}
2708
2709void DrawNodeMethodsTest::drawAll()
2710{
2711 static float rotation = 0.1f;
2712 rotation += 0.1;
2713 if (rotation > 62.8f)
2714 {
2715 rotation = 0.0f;
2716 }
2717
2718 drawNode->clear();
2719 drawNode->properties.setDefaultValues();
2720
2721 labelRound->setVisible(false);
2722 labelSquare->setVisible(false);
2723 labelButt->setVisible(false);
2724
2725 switch (_currentSeletedItemIndex)
2726 {
2727 case drawMethodes::Line:
2728 {
2729 for (int i = 0; i < 100; i++)
2730 {
2731 drawNode->drawLine(Vec2(-size.x / 2, -size.y / 2 + i * 4), Vec2(size.x - 50, -size.y / 2 + i * 4),
2732 Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f),
2733 sliderValue[sliderType::Thickness]);
2734 }
2735
2736 break;
2737 }
2738 case drawMethodes::Rect:
2739 {
2740 Vec2 rec;
2741 for (int i = 0; i < 100; i++)
2742 {
2743 rec = Vec2(i * 3, i * 3);
2744 drawNode->drawRect(center / 2 - rec, center / 2 + rec,
2745 Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f),
2746 sliderValue[sliderType::Thickness]);
2747 }
2748
2749 break;
2750 }
2751 case drawMethodes::Circle:
2752 {
2753 for (int i = 0; i < 100; i++)
2754 {
2755 drawNode->drawCircle(VisibleRect::center(), 3 * i, AX_DEGREES_TO_RADIANS(90), i, false, 1.0f, 1.0f,
2756 Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f),
2757 sliderValue[sliderType::Thickness]);
2758 }
2759
2760 break;
2761 }
2762 case drawMethodes::QuadBezier:
2763 {
2764 drawNode->drawQuadBezier(Vec2(size.width - 150, size.height - 150), Vec2(size.width - 70, size.height - 10),
2765 Vec2(size.width - 10, size.height - 10), 10, Color4F::BLUE,
2766 sliderValue[sliderType::Thickness]);

Callers

nothing calls this directly

Calls 15

createFunction · 0.85
drawCircleMethod · 0.80
drawQuadBezierMethod · 0.80
drawCubicBezierMethod · 0.80
drawCardinalSplineMethod · 0.80
drawCatmullRomMethod · 0.80
drawPolyMethod · 0.80
drawDotMethod · 0.80
drawPointMethod · 0.80
drawPointsMethod · 0.80
drawColoredTriangleMethod · 0.80
drawSolidTriangleMethod · 0.80

Tested by

no test coverage detected