animated-vector-drawable
animated-vector-drawable copied to clipboard
How to actually make shapes?
Thanks for the tutorial!
Where did you get or come up with these?
<string name="path_circle">
M 50,50
m -48,0
a 48,48 0 1,0 96,0
a 48,48 0 1,0 -96,0
</string>
<string name="path_face_left_eye">
M 35,40
m -7,0
a 7,7 0 1,0 14,0
a 7,7 0 1,0 -14,0
</string>
<string name="path_face_right_eye">
M 65,40
m -7,0
a 7,7 0 1,0 14,0
a 7,7 0 1,0 -14,0
</string>
<string name="path_face_mouth_sad">
M 30,75
Q 50,55 70,75
</string>
<string name="path_face_mouth_happy">
M 30,65
Q 50,85 70,65
</string>
How do I go about making arbitrary shapes?
Bump! How do we actually generate all these path values for morph? Thanks heap!
I created an SVG path by hand, then took the d
variable to use as the value in the string. Here is an SVG path tutorial: http://tutorials.jenkov.com/svg/path-element.html
For morphing to work, each path needs to have the same number of commands (M
, a
, Q
etc), and each command needs to have the same number of variables. Unfortunately I don't know any tools that generates that for you.
I think you can convert SVG files to Android VectorDrawable files using online tools, like this one: http://inloop.github.io/svg2android/