shrink in the way

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

shrink in the way

Post by Samuele » Wed Jan 26, 2022 5:34 pm

Hi, I'm trying to show a field in the middle of the stack and after 2 seconds move it

Code: Select all

into the points of graphic "someGraphic"
and till here it's okay, but i wanted to add something else, that in the mean time that the field is going in the path of the graphic it also shrinks gradually, till it arrives to the 'end' of the graphic and it's still visible, is it possible?
Thanks!
Samuele.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: shrink in the way

Post by jmburnod » Wed Jan 26, 2022 5:47 pm

Hi Samuel
is it possible?
You may resize field in a loop using the num of points
Best regards
Jean-Marc
https://alternatic.ch

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: shrink in the way

Post by Samuele » Wed Jan 26, 2022 6:12 pm

jmburnod wrote:
Wed Jan 26, 2022 5:47 pm
You may resize field in a loop using the num of points
Sorry, couldn't quite understand, what points do you mean? of the graphic?
something like: for every 2 points in the graphic take it down a notch? (obviously this can't be a script)
Thanks!
Samuele.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: shrink in the way

Post by dunbarx » Wed Jan 26, 2022 6:26 pm

In the manner of what Jean-Marc mentioned, think about this. When you move an object to the points of a graphic, say, LC moves to successive lines of the "points" (a property) of that graphic.

But what you want to do is to reduce the field every time it reaches a new point. So work on this:
ShrinkingField.livecode.zip
(1.36 KiB) Downloaded 76 times
Craig
Last edited by dunbarx on Wed Jan 26, 2022 6:43 pm, edited 2 times in total.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: shrink in the way

Post by jmburnod » Wed Jan 26, 2022 6:37 pm

the graphic?
Oups ! Sorry
Yes and you made it :D
Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: shrink in the way

Post by dunbarx » Wed Jan 26, 2022 6:38 pm

I never use the "move" command, except for play.

But I wonder if it is possible to do what the OP wants, not with the heavy-handed stack I just posted, but by trapping say, the "locationChanged" message while moving through the points of a graphic. One would have to remember the most recent point and only reduce the size when that changes, otherwise the control would reduce too fast, I think.

Hmmm.

Craig

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: shrink in the way

Post by Samuele » Wed Jan 26, 2022 6:48 pm

alright, thanks, i don't fully understand the script, but I'm trying, is there a way to do it without causing to the stack to stop for the moving (probably without the wait) Thanks!
Samuele.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: shrink in the way

Post by dunbarx » Wed Jan 26, 2022 9:24 pm

Hi.
is there a way to do it without causing to the stack to stop for the moving (probably without the wait) Thanks!
Not sure what you mean. How does a stack "stop"? When you click the button, the square field tracks the graphic, and shrinks just a bit at each point. What did you intend, or wish for?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: shrink in the way

Post by dunbarx » Wed Jan 26, 2022 9:32 pm

You say you don't understand the script, have you tried stepping through the handler? Place a breakpoint at line 9, where the width is changed. Now manually step through. You can see that the field jumps to successive points of the graphic, and once there, shrinks just a little. It then goes to the next point...

Remember that the "points" of a graphic is a return delimited list; each line in that list contains one point.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”