How to use movePolygonalEaseInOut?

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
drkosta
Posts: 34
Joined: Wed May 22, 2013 8:40 pm
Location: Stuttgart / Germany
Contact:

How to use movePolygonalEaseInOut?

Post by drkosta » Tue Nov 17, 2020 1:06 am

Hi there,

I cannot figure out how to use movePolygonalEaseInOut with its parameters.

What I wanted to do is to move a graphic along a path with an effect similar to

aeMoveTo grc "myGrc" , x,y, duration, InOut

so I tried with this in button script:

Code: Select all

on mouseUp
   if the flag of me is empty then set the flag of me to false 
   set the flag of me to not the flag of me
   moveDot
end mouseUp

on moveDot
   if the movePolygonal["moveDone"] of grc "myDot" is true then
      set the loc of grc "myDot" to the movePolygonal["endpoint"] of grc "myDot"
      set the movePolygonal["moveDone"] of grc "myDot" to false
   else
      if the flag of widget "Run/Stop" of card id 1002 of me then
         send "movePolygonal" to grc "myDot"
         send "moveDot" to me in 5 milliseconds
      end if
   end if
end moveDot


The result was, what I expected that a graphic moves along the given path. But now a cannot figure out how to let move the object along the path with an EaseEffect.

Tried with send "movePolygonalEaseInOut 10, 1500, 2" instead of send "movePolygonal" to grc "myDot" in moveDot handler but then the object does not move at all.

Putting send "movePolygonalEaseInOut 10, 1500, 2" into mouseUp handler, I can control how fast the object is moving along the path by editing the parameters, but no easeInOut Effect. Any Ideas?


Buttonscript:

Code: Select all

on mouseUp
   if the flag of me is empty then set the flag of me to false 
   set the flag of me to not the flag of me
   send "movepolygonaleaseInOut 3,1500,2" to grc "myDot"
   moveDot
end mouseUp

on moveDot
   if the movePolygonal["moveDone"] of grc "myDot" is true then
      set the loc of grc "myDot" to the movePolygonal["endpoint"] of grc "myDot"
      set the movePolygonal["moveDone"] of grc "myDot" to false
   else
      if the flag of widget "Run/Stop" of card id 1002 of me then
         send "movePolygonal" to grc "myDot"
         send "moveDot" to me in 5 milliseconds
      end if
   end if
end moveDot


Post Reply

Return to “Animation Engine”