The Incredible SuperCard Shrink Tool
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
The Incredible SuperCard Shrink Tool
I have at times, lamented that I miss the old incredible SuperCard Shrink Tool that gave one the ability to shrink a polygon tightly around any assembly of other objects. I made extensive use of that tool back in the day, and have seen many instances in this forum and the List where this would have been THE solution.
The attached stack is my latest attempt to recreate that tool, but as you can see, it just doesn't cut it! Although the code here is straightforward, it doesn't seem to behave well, You can witness this yourself by simply commenting out the "lock Screen" script.
I am befuddled! If SuperCard can do this, why can't LC? And, what's wrong with my code????
Roger
The attached stack is my latest attempt to recreate that tool, but as you can see, it just doesn't cut it! Although the code here is straightforward, it doesn't seem to behave well, You can witness this yourself by simply commenting out the "lock Screen" script.
I am befuddled! If SuperCard can do this, why can't LC? And, what's wrong with my code????
Roger
Re: The Incredible SuperCard Shrink Tool
Roger.
I am not understanding how to even start. If I just click on the button, nothing (after a moment) particularly happens. And when you say "commenting out the "lock Screen" script." I do not know what you mean.
Craig
I am not understanding how to even start. If I just click on the button, nothing (after a moment) particularly happens. And when you say "commenting out the "lock Screen" script." I do not know what you mean.
Craig
Re: The Incredible SuperCard Shrink Tool
Very strange. You should see a blue shape (poly) looking vaguely like Rect1 and Rect2 combined after a few seconds. Then if you look at the mouseUp script of the button, you can comment out the Lock Screen in line 6. This will allow you to see how the script is generating this blue poly. I hope that helps and I'm sorry for confusing you.
Roger
Roger
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: The Incredible SuperCard Shrink Tool
Interestingly enough SuperCard does NOT seem to allow
you to set the size of the corner curve on rounded
rectangles:
- -
Though this is an interesting approach:
- -
BUT, I cannot find the Shrink Tool . . .

-
- VIP Livecode Opensource Backer
- Posts: 10055
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: The Incredible SuperCard Shrink Tool
Was the Shrink tool only in SuperEdit?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: The Incredible SuperCard Shrink Tool
I wonder how to make those 2 SLIDERS permanently visible?
Re: The Incredible SuperCard Shrink Tool
Ah, I see now. I moved the two shapes around and then clicked the button. I thought the circle was going to shrink around those shapes.
And yes, if the two shapes get too far apart, it breaks down.
Craig
And yes, if the two shapes get too far apart, it breaks down.
Craig
Re: The Incredible SuperCard Shrink Tool
Rereading, I see that the point was to have a polygon shrink around a few shapes. But how would this be managed? If any irregular polygon was the object to be shrunk, then choices would have to be made about how to keep as much as possible to the original angles and ratios of the starting shape.
This might be better than to continue working...
Craig
This might be better than to continue working...
Craig
Re: The Incredible SuperCard Shrink Tool
This seems straightforward, if not trivial. If one has an irregular polygon and a control, all you have to do is (pseudo":
Will take a stab...
Craig
Code: Select all
set the loc of the control to the loc of the polygon
break the sides of the polygon into separate lines using the points of that polygon
find the angle that is 90° to each line that "points" inward toward the control
move each line along that angle until intersects the control
trim the inevitable overlaps of the several lines
create a new polygon with the points of all the lines
lose the lines
Craig
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: The Incredible SuperCard Shrink Tool
Stab, stab!
But, why couldn't I find the Shrink Tool in SuperCard?
But, why couldn't I find the Shrink Tool in SuperCard?
-
- VIP Livecode Opensource Backer
- Posts: 10055
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: The Incredible SuperCard Shrink Tool
If memory serves, it wasn't a language feature, but a layout convenience added into SC's SuperEdit from SuperPaint:
viewtopic.php?f=9&t=36472&start=30#p210767
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: The Incredible SuperCard Shrink Tool
If I understand correctly what the shrink tool did, namely to take a bunch or a single graphic and return the outer contour as a polygone graphic then I have here a stack that can do this.
It does it by taking a snapshot of a group containing graphic and tracing the image for the contour of the resultant composite outline.
I repurposed an old tool of mine for this.
Kind regards
Bernd
It does it by taking a snapshot of a group containing graphic and tracing the image for the contour of the resultant composite outline.
I repurposed an old tool of mine for this.
Kind regards
Bernd
- Attachments
-
- TraceOutlineOfGraphics.livecode.zip
- (14.67 KiB) Downloaded 181 times
Re: The Incredible SuperCard Shrink Tool
That's amazing Bernd!
Re: The Incredible SuperCard Shrink Tool
Bernd, you astound me again with your genius. I only had a quick look at how your tracing is done, but that, of course is the trick! I have my work cut out to understand it.
Thanks,
Roger
Thanks,
Roger