Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Collider on Canvas/Path curve?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8324

    Senad

    Hi Guys,

    Assuming this snippet:

     

    Canvas {
        width: 400; height: 200
        contextType: "2d"
    
        Path {
            id: myPath
            startX: 0; startY: 100
    
            PathCurve { x: 75; y: 75 }
            PathCurve { x: 200; y: 150 }
            PathCurve { x: 325; y: 25 }
            PathCurve { x: 400; y: 100 }
        }
    
        onPaint: {
            context.strokeStyle = Qt.rgba(.4,.6,.8);
            context.path = myPath;
            context.stroke();
        }
    }
    
    Can there be a Colider along the path curve? (or something similar?)
    
    Thanks,
    
    
    
    #8326

    Alex
    Felgo Team

    Hi,

    I see 2 options here; A series of PolygonColliders or a series of BoxColliders with different rotations to approximate the shape. Of course, the bigger the curve, and the closer the approximation, it will get quite tedious to set up all the colliders.

    In the newest version of the Box2D-QML plugin that we use, they added a new Shape which will simplify setting up such colliders. Unfortunately they had some very rough changes to the whole API, so it will take us some time to switch to the newest version, we won’t be able add this to the next update.

    Best Regards,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded