the polygon tool
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
the polygon tool
The polygon tool has the dashed edit thing around it (editmode I think it has to do with) as you click the points to form the polygon. Is there a way to not have that around it. I am using a button that chooses polygon tool and the user needs to draw the polygon but having that editmode thing around it while they do, doesn't look right. I know the polygon paint tool doesn't have it, but this needs to be a graphic.
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: the polygon tool
Hi.
I don't think so. LC is not a CAD program, though I wish it was. In that world, generally only the handles of an object are "hilited", available for dragging or for a command line instruction, and I think this is what you want.
I bet it is just the way LC rolls.
Craig Newman
I don't think so. LC is not a CAD program, though I wish it was. In that world, generally only the handles of an object are "hilited", available for dragging or for a command line instruction, and I think this is what you want.
I bet it is just the way LC rolls.
Craig Newman
Re: the polygon tool
You could ask the user to click on the card, record the points and save them in a variable, and set the points of a new polygon to that variable.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: the polygon tool
Mark.
Sometimes the points have to be precise. You idea would work if "fairly close" was adequate.
In a CAD program, the cursor snaps to a handle when it gets to within a few pixels of the actual point. LC does not have that feature, though it can be scripted.
Craig
Sometimes the points have to be precise. You idea would work if "fairly close" was adequate.
In a CAD program, the cursor snaps to a handle when it gets to within a few pixels of the actual point. LC does not have that feature, though it can be scripted.
Craig
Re: the polygon tool
the correct title of this thread should have been Polygon Graphic tool as the Polygon tool for paint drawing doesn't have the problem.
Seems odd that it needs to be there while "drawing" or clicking the points of the polygon as it has no purpose until all the polygons points are set, and after it is set they are not visible unless in edit (and that can be changed with a property I think). I'd call it a bug
dunbarx, I'm not looking to change functionality, I just don't like the look and confusion of the dashed lines edit thingy around the polygon cursor and points as you click the points it is confusing looking and useless.
Hmmm Mark your suggestion is interesting, perhaps I can roll my own graphic tool. Maybe if I drop a marker image over each location and use a line to first connect to the mouse pointer then the next point etc, and eventually set a polygon with all the points as mark suggests. This could make something that approximates the LC polygon graphic tool. Sound feasible? Has this been done before?
Seems odd that it needs to be there while "drawing" or clicking the points of the polygon as it has no purpose until all the polygons points are set, and after it is set they are not visible unless in edit (and that can be changed with a property I think). I'd call it a bug
dunbarx, I'm not looking to change functionality, I just don't like the look and confusion of the dashed lines edit thingy around the polygon cursor and points as you click the points it is confusing looking and useless.
Hmmm Mark your suggestion is interesting, perhaps I can roll my own graphic tool. Maybe if I drop a marker image over each location and use a line to first connect to the mouse pointer then the next point etc, and eventually set a polygon with all the points as mark suggests. This could make something that approximates the LC polygon graphic tool. Sound feasible? Has this been done before?
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: the polygon tool
Hi.
I can see how the rect that encloses the burgeoning polygon might be considered clutter.
It does however have use as a guide to the overall extent of the control. Know that if one clicks on a point within that rect, even though that point is "outside" what appears to be the visible "interior" of the graphic, LC considers that click to be within the rect of the graphic. This is important, and has engendered many threads, because you can set the opaque of the graphic to "true" and then set a backGround fill. You will get only the "interior" filled. But the rect still rules.
Anyway, Try a feature request to QCC, to be able to turn the phantom rect off.
Craig
I can see how the rect that encloses the burgeoning polygon might be considered clutter.
It does however have use as a guide to the overall extent of the control. Know that if one clicks on a point within that rect, even though that point is "outside" what appears to be the visible "interior" of the graphic, LC considers that click to be within the rect of the graphic. This is important, and has engendered many threads, because you can set the opaque of the graphic to "true" and then set a backGround fill. You will get only the "interior" filled. But the rect still rules.
Anyway, Try a feature request to QCC, to be able to turn the phantom rect off.
Craig
Re: the polygon tool
Dont think it will be needed, I'm trying my hand at rolling my own polygon graphic tool
I create a graphic called Polygon and then this in the card script works well to draw the polygon
My tool is actually better in that it closes the polygon
If I can figure out a way to have a line from last point to the mouse cursor while setting the points I think it will be perfect
I create a graphic called Polygon and then this in the card script works well to draw the polygon
Code: Select all
local drawing, closeit
on mouseUp pButtonNumber
put true into drawing
set the points of grc "draw" to the points of grc "draw" & cr & the mouseLoc
end mouseUp
on mouseDoubleUp pButtonNumber
get line 1 of the points of graphic "draw"
set the points of grc "draw" to points of grc "draw" & cr & it
put false into drawing
end mouseDoubleUp
If I can figure out a way to have a line from last point to the mouse cursor while setting the points I think it will be perfect
Re: the polygon tool
Ok got my better polygon graphic tool with the line to the mouse working. Needs a little code for the cross mouse cursor and to move on to the next polygon if needed, but I have to say I'm happy with the result.
Code: Select all
local drawing, closeit
on mouseUp pButtonNumber
put true into drawing
set the points of grc "draw" to the points of grc "draw" & cr & the mouseLoc
end mouseUp
on mouseDoubleUp pButtonNumber
get line 1 of the points of grc "draw"
set the points of grc "draw" to points of grc "draw" & cr & it
put false into drawing
end mouseDoubleUp
on mouseMove pNewMouseH, pNewMouseV
if drawing contains true then
get last line of the points of grc "draw"
set the points of grc "lastpoint" to it & cr & the mouseLoc
else
exit mouseMove
end if
end mouseMove