Paper.js Z-Index and Binding Object
Asked Answered
S

2

0

I am studing paper.js and don´t found how resolve my problem. See my application test in: http://www.plugbox.com.br/reta.htm

The red circle covers only the Y axis and blue circle covers only the X axis and the starting point and the end point of the line follow the red and blue points.

But the line is in front of circles. How do I set the "z-index" line by placing it in a layer behind the points?

Another question is:

How do I put a third point, for example, in the middle of the line and make it draggable only on the line?

Thank´s!

Spent answered 5/9, 2014 at 18:4 Comment(1)
As for the draggable point: make it a second questions, because these two do have nothing in common.Oresund
D
7

But the line is in front of circles. How do I set the "z-index" line by placing it in a layer behind the points?

Every item has methods:
insertAbove(item) //Inserts this item above the specified item.
insertBelow(item) //Inserts this item below the specified item.
sendToBack() //Sends this item to the back of all other items within the same parent.

source

Damselfly answered 11/9, 2014 at 15:9 Comment(0)
O
0

It's easy. Draw the line first and the dots afterward.Just with a real-life painting: what you draw last is atop everything you have drawn first. Plain SVG behaves the same btw.

Oresund answered 29/10, 2016 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.