Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经使用 Canvas 和 KineticJS 制作了几个简单的粒子和游戏示例,并且我正在考虑使用像 Nivo 这样的滑块来展示它们。首先的想法是,我需要在滑块过渡时重新绘制每个画布,但我只是想知道是否有人已经尝试过这个并成功或失败,是否可行?
尝试:
var mystage = stage.toImage(config);
将画布转换为图像,然后您可以转换图像。
但是,如果您希望将整个舞台保存为一个对象,您只需执行以下操作:
var json = stage.toJSON();
这样可以节省您的舞台以供以后重新加载,您可以这样做:
var stage = Kinetic.Node.create(json, 'container');