Forums

OverviewV-Play 2 Support (Qt 5) › Curved lines and dashed line

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12261

    Kool

    Hi guys,

    I’m looking for two things.

    The first is a curved line, along the lines of defining a start point and an end point and between points to ‘curve’. Is there anything like this in V-Play/Qt Quick?

    The second is to take this curved line, and draw it in a ‘dashed’ mode, rather than one solid line.

    Cheers in advance!

    #12262

    Günther
    V-Play Team

    The QML Canvas type allows to draw curves, for example with the bezierCurveTo(…) method.
    I don’t know of a simple way to make dashed lines though. Maybe you can find a custom solution online that works for you.

    Cheers,
    Günther

     

    #12403

    Nathan

    Hi, KoolBanana. This function works for drawing dashed lines on a canvas: https://davidowens.wordpress.com/2010/09/07/html-5-canvas-and-dashed-lines/ Instead of adding the function to the context prototype, just set it on the context directly: context.dashedLineTo = function(...){...} Note that after drawing your line(s) you need to call context.stroke() in order to make them visible on your canvas.

    That doesn’t help you directly with curved dashed lines, but perhaps it’ll give you a start? Good luck.

    #12404

    Kool

    Hi Nathan,

    Much appreciated. I’ll definitely check this out and post any updates!

    Cheers

    #12405

    Nathan

    Please do! If you get a working curved dotted line version, I’ll be interested to see it. :) Good luck

Viewing 5 posts - 1 through 5 (of 5 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