+ 3
Can i get more than 1 SVG image to animateMotion?
I tried 2 it's only running the first ignoring the second is there a tag that can help or something?
9 odpowiedzi
+ 5
Along with checking <defs> element, take a look to <g> (group) and <symbol> elements: they are both also a usefull way of grouping elements, with each some specificities ;)
+ 7
If by "svg image" you are meaning "svg element", yes you can... but refering to this code found in your playground profil:
https://code.sololearn.com/WUh6xc4RgJnt/?ref=app#html
... you need to correctly build your <svg> by correctly closing it (or them, you can have more than once <svg> element in a html document) and not mixing html and svg element inside ^^
In addition, <animateMotion> element is designed to use path as track for movement: you better need a simple <animation> element to do a linear movement...
Anyway, in all case, you can use and refer to a same <path> object element id in many <animateMotion> element by using 'mpath' attribute rather than the 'path' defining one: check also use of <defs> element to define not initially shown svg elements than you can use many time elsewhere ;)
+ 3
Correct write is </rect> and </polygon>... not <\rect> and <\polygon> ^^
And need to correctly close tags was already pointed in my first post ;P
+ 2
Thank you visph!!! This is still very new to me. I am trying to get multiple planes in the sky moving above the device motion one and move buildings as a unit with the rectangle body and polygon roof. Hopefully I can now accomplish this with your advice. I appreciate the help!!!
+ 1
Sí Raynier , ¿qué uso para que sea inherente?
+ 1
Thank you visph I will try that. The advice here is so much better than the varied answers I get from Google when I attempt to ask. The helpful members here make learning this lots of fun!!!
+ 1
Shane over on Slack showed me I needed to close the shapes after animateMotion <\rect><\polygon> it's working like a charm.
+ 1
Thanks visph I thought they we're closed enough already ...live and learn.
- 1
Si, tu puedes hacerlo!