Forums

OverviewV-Play 2 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
    V-Play 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support