简体   繁体   English

盆景js在轨道上

[英]Bonsai js in Orbit

I can add my shapes to the stage and get them to do fades and such, but I can't get them to morph - do I need to separate out into lines and curves somehow? 我可以将自己的形状添加到舞台上,让它们进行淡入淡出等效果,但是我无法使其变形-我需要以某种方式分离为直线和曲线吗?

var shape = new Path('M 321.051,510.078 c 0,0-10.126-23.854-19.438-45.792 c -7.927-18.675-15.265-35.961-15.265-35.961 s -17.977-41.111-19.036-77.643 c -1.05-36.243,14.817-67.908,14.817-67.908 s -36.176,73.71-49.086,137.219 c -9.327,45.879,3.426,87.39,3.426,87.39 L 321.051,510.078 z').attr({fillColor: 'red'});

stage.addChild(shape);

var targetPath = new Path('M 321.75,515.816 c 0,0,8.678-42.28,0.604-77.096 c -8.102-34.936-32.956-62.408-32.956-62.408 l -76.102-96.41c0,0-39.866-41.142-45.55-84.785 c -4.992-38.332,24.108-79.856,24.108-79.856 s -55.379,72.451-63.818,141.683 c -6.186,50.745,33.857,104.106,33.857,104.106 s 36.746,38.732,51.061,75.346 c 13.283,33.975,4.212,66.029,4.212,66.029L326.75,515.816 z').attr({fillColor: 'blue'});

shape.addTo(stage);

shape.morphTo(targetPath, '3s');

Bonsai 0.4.1 doesn't support smooth curves (s, S) SVG commands. 盆景0.4.1不支持平滑曲线(s,S)SVG命令。 See related ticket: https://github.com/uxebu/bonsai/issues/191 请参阅相关票证: https : //github.com/uxebu/bonsai/issues/191

I guess you get it to work by removing those commands. 我想您可以通过删除这些命令来使其工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM