Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animating shape inside an SVG #758

Open
miguelc95 opened this issue May 12, 2021 · 0 comments
Open

Animating shape inside an SVG #758

miguelc95 opened this issue May 12, 2021 · 0 comments

Comments

@miguelc95
Copy link

miguelc95 commented May 12, 2021

Hi! I have been using it to change colors and moving shapes inside an SVG based on some calculations and it's been working perfectly, however I try the following:

let trainNode = self.mapView.node.nodeBy(tag: "train1")
let trainShape = trainNode as! Shape
trainShape.fill = Color.blue
let move = Transform.move(dx: currentStation.path.last!.first! - 15, dy: currentStation.path.last!.last! - 20)
trainShape.placeVar.animate(from: trainShape.place, to: move, during: 10, delay: 0)

But disappears and just appears at the finishing place instead of animatedly moving to it

How could I achieve this?

I also tried with:

animate(along: Path)
But the same thing occurs, it just shows up at the end of the path

Thanks in advance and great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant