Skip to content

Commit

Permalink
adding hack because material isnt immediately available
Browse files Browse the repository at this point in the history
  • Loading branch information
richardanaya committed Jun 14, 2016
1 parent ae8bc86 commit 794f64a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
ctx.clearRect(0,0,this.data.width,this.data.height);
var texture = new THREE.Texture(this.canvas);
var material = new THREE.MeshBasicMaterial({ map: texture, transparent: true });
this.el.object3D.children[0].material = material;

//HACK: on the build of aframe i'm using child[0] is not immediately available
setTimeout(function(){
_this.el.object3D.children[0].material = material;
},100)

if(!this.frame) {
this.frame = document.createElement("iframe");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aframe-html",
"version": "0.0.3",
"version": "0.0.4",
"description": "A component rendering and interacting with HTML in VR",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 794f64a

Please sign in to comment.