MCPcopy
hub / github.com/aframevr/aframe / entityFactory

Function entityFactory

tests/helpers.js:24–42  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

22 * @returns {object} An `<a-entity>` element.
23 */
24export function entityFactory (opts) {
25 var scene = document.createElement('a-scene');
26 var assets = document.createElement('a-assets');
27 var entity = document.createElement('a-entity');
28
29 scene.appendChild(assets);
30 scene.appendChild(entity);
31
32 opts = opts || {};
33
34 if (opts.assets) {
35 opts.assets.forEach(function (asset) {
36 assets.appendChild(asset);
37 });
38 }
39
40 document.body.appendChild(scene);
41 return entity;
42}
43
44/**
45 * A more robust entity factory that resolves once stuff is loaded without having to wait

Callers 15

light.test.jsFile · 0.90
text.test.jsFile · 0.90
position.test.jsFile · 0.90
link.test.jsFile · 0.90
rotation.test.jsFile · 0.90
material.test.jsFile · 0.90
raycaster.test.jsFile · 0.90
animation.test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected