Reputation: 13233
How to get the scene, from within a component .init()
function in A-Frame?
AFRAME.registerComponent('foo', {
init: function () {
// ?
}
});
Upvotes: 1
Views: 1714
Reputation: 13233
https://aframe.io/docs/0.4.0/core/component.html#component-prototype-properties
AFRAME.registerComponent('foo', {
init: function () {
console.log(this.el.sceneEl);
},
update: function () {
console.log(this.el.sceneEl);
}
});
Upvotes: 3