I’m not sure what the correct syntax is to get the current xy coordinates for an image that is moving on a path.
I’m interested in the coordinates because I want to change the camera position to a new area when the image leaves the screen.
I’m not sure what the correct syntax is to get the current xy coordinates for an image that is moving on a path.
I’m interested in the coordinates because I want to change the camera position to a new area when the image leaves the screen.
I think I found one way to do this:
image.startFollow({
duration: 2000,
positionOnPath: true,
onUpdate:()=>updateCallback(),
repeat: 0
});
function updateCallback (){
if(Math.floor(image.x) < 860){
text1.setText(['x: ' + Math.floor(image.x),'y: ' + Math.floor(image.y)]);
}
}