Stop-Start: animation along a path

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

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Stop-Start: animation along a path

Post by MaxV » Mon Jul 04, 2016 4:26 pm

Well, you can use the same code also with the points of any graphic. It works better and smoother, because it uses the send loop. Look here:

########CODE#######
on mouseUp
if the label of me is "GO" then
set the label of me to "STOP"
else
set the label of me to "GO"
end if
moveSun
end mouseUp

on moveSun
if the label of me is "STOP" then
put the points of graphic 1 into mypoints
put the angolo of me into temp
if temp is empty then put 1 into temp #this is useful for the first launch
put line temp of mypoints into newloc
set the loc of button "Sun" to newLoc
add 1 to temp
if temp > the number of lines of mypoints then
put empty into temp
end if
set the angolo of me to temp
send "movesun" to me in 0.01 sec
end if
end moveSun
#####END OF CODE#####

Moreover you can also edit the graphic during sun movement!!!
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Stop-Start: animation along a path

Post by MaxV » Mon Jul 04, 2016 5:09 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Stop-Start: animation along a path

Post by richmond62 » Mon Jul 04, 2016 5:10 pm

Very elegant; instead of using a listField you use a variable; quicker
but not quite so easy for learners to visualise.

Lovely video!

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Stop-Start: animation along a path

Post by capellan » Sat Sep 24, 2016 5:30 am

Hi All,

I found a tutorial about this topic in MaxV website:
http://livecodeitalia.blogspot.it/2016/ ... reale.html
and just made a variation that shows a pen drawing vector paths.

Download attached stack: "MaxV Interactive Drawing path.livecode.zip" and play with it.
Every idea to improve usefulness and performance of this stack is welcome.

Alejandro
A0010.jpg
MaxV Interactive Drawing path.livecode.zip

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Stop-Start: animation along a path

Post by capellan » Sat Sep 24, 2016 11:43 pm

This is version 02 of previous stack.

With more additional tools and scripts, this stack could be
actually useful to create animations that looks like those
youtube videos where a hand is drawing over a whiteboard.
A0011.jpg
MaxV Interactive Drawing path 02.livecode.zip

Post Reply