Skip to content

DrawNode draws in wrong order #1888

Closed
Closed
@NgVThangBz

Description

@NgVThangBz
  • axmol version: All Version
  • devices test on: All device
  • developing environments: all platform
    • NDK version: r23c
    • Xcode version: 14.2+
    • Visual Studio:
      • VS version: 2022 (17.9+)
      • MSVC version: 19.39+
      • Windows SDK version: 10.0.22621.0+
    • cmake version:
      Steps to Reproduce:

Looking at the code below, you can see that in the draw node the drawing order will be triangle, point, line:
Screenshot 2024-05-07 at 14 51 17
So even if the triangle is added after the point, it is still drawn first, leading to the triangles always being covered by lines,

In my opinion: it would be good if lines, triangles, points are drawn one after another in the order they are added

can check code:
DrawNode* _drawNode = DrawNode::create();
Director::getInstance()->getRunningScene()->addChild(_drawNode,100);
_drawNode->drawLine(Vec2(200,200),Vec2(500,500),Color4B::RED);
_drawNode->drawSolidRect(Vec2(200,200),Vec2(500,500),Color4B::YELLOW);

and result:

Screenshot 2024-05-07 at 15 03 19

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions