使用数据处理源完全重新装入画布元素 [英] Completely reloading a canvas element with data-processing-sources

查看:118
本文介绍了使用数据处理源完全重新装入画布元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<div class="Container"><div class="SubContainer">
<canvas id="gamecanvas" data-processing-sources="canvas.pde">
ERROR - No canvas support on browser
</canvas>
</div></div>

<div class="Container"><div class="SubContainer">
<canvas id="hudcanvas" data-processing-sources="hud.pde">
ERROR - No canvas support on browser
</canvas>
</div></div>

我有这两个画布使用processing.js和WebGL 3D,基本上我需要他们重新加载以调整其大小。我试着使用jQuery克隆它们,删除它们,然后将它们附加到body,但它不工作。画布是附加的,他们有所有的属性,但我的猜测将是数据处理源不能做到它的东西。

I have these two canvas's using processing.js and WebGL 3D, and basically I need them to reload in order to adjust their size. I tried using jQuery to clone them, remove them, and then append them to the body, but it doesn't work. The canvas's were appended and they had all their properties, but my guess would be the data-processing-sources wasn't able to do its thing.

所以

推荐答案

如何使这些画布完全重新加载,包括重新运行它们的数据处理源?这可以通过使用iframe到另一个页面与您的画布,你可以调整大小和刷新,而仍然在你的主页。

This can be done by using an iframe to another page with your canvas that you can resize and refresh while still on your main page.

这篇关于使用数据处理源完全重新装入画布元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆