Trithilon
Topic Author
Posts: 15
Joined: 06 May 2014, 19:05

Lines, Curves and Splines?

28 May 2014, 12:11

Hi,

I am trying to see if I can make splines which I can drag and connect to other controls. Similar to the lines you get in Unreal Kismet.

The functionality is similar to a popular line rendering solution for Unity :
http://www.starscenesoftware.com/vectrosity.html

The result could be similar to how a GUI solution called EVO GUI for Unity does it.
https://www.assetstore.unity3d.com/en/#!/content/11171

Please help. :)

Regards.
 
User avatar
sfernandez
Site Admin
Posts: 2995
Joined: 22 Dec 2011, 19:20

Re: Lines, Curves and Splines?

28 May 2014, 17:15

For basic shapes you can take a look at the Shapes tutorial here.

For complex shapes you should use the Path element, which uses SVG commands (Path Markup Syntax) to define its shape, for example:
<Path Data="M241.49998,264.49971 C314.49993,277.49971 374.5,397.5 437.5,409.5 500.5,421.5 564.49993,410.49925 583.49972,373.49992 601.23897,338.95531 540.49976,312.49983 533.49976,283.49983 523.0081,358.44328 441.5,358.49999 414.5,284.5 387.5,210.50001 423.9727,183.10478 452.9727,179.10478 481.9727,175.10478 516.63937,193.7711 587.9727,198.10443" Height="236.597" Stretch="Fill" Stroke="Red" Width="347.473"/>
path.png
path.png (2.93 KiB) Viewed 1912 times
 
User avatar
jsantos
Site Admin
Posts: 3919
Joined: 20 Jan 2012, 17:18
Contact:

Re: Lines, Curves and Splines?

29 May 2014, 15:11

If you need this via API instead of Xaml you must use StreamGeometryContext. It supports Beziers (quadratic and cubic) and Arcs. You can easily create Splines using that primitives.
 
Trithilon
Topic Author
Posts: 15
Joined: 06 May 2014, 19:05

Re: Lines, Curves and Splines?

05 Jun 2014, 11:42

Wow, useful! Thanks! :)

Who is online

Users browsing this forum: No registered users and 11 guests