return False or true or detect if picture are moving ?

Hi guys.


Existe a way to check if picture are in moving ? in javascript


i need to get a return false or true or get a valur , maybe the time valur in the move picture.


Tanks.
You should be able to use the following to check if a picture is moving :


($gameScreen.picture(pictureId)._targetX != 0 || $gameScreen.picture(pictureId)._targetY != 0) && $gameScreen.picture(pictureId)._duration != 0;




If you are wanting to wait for a picture to reach a specified destination within an event, you can use the following commands :

Code:
◆Loop
  ◆Comment:// Check if _x or _y are at a certain position
  ◆If:Script:$gameScreen.picture(1)._x === 125
    ◆Comment:// Break Loop if at Position
    ◆Break Loop
    ◆
  :End
  ◆Comment:// Wait 1 Frame if Picture is not at Position
  ◆Wait:1 frame
  ◆
:Repeat Above

Original thread: https://forums.rpgmakerweb.com/threads/return-false-or-true-or-detect-if-picture-are-moving.69541/