Skip to content

Commit

Permalink
Merge pull request #160 from AltspaceVR/bug/popup-example
Browse files Browse the repository at this point in the history
Adjust popup cube to enclosure
  • Loading branch information
brianpeiris committed Nov 22, 2016
2 parents e300438 + 8fb19d7 commit c27ea0c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions examples/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
altspace.utilities.sync.connect(config).then(function(connection) {
sceneSync = altspace.utilities.behaviors.SceneSync(connection.instance, {
instantiators: {
'cube': createCube,
'sphere': createSphere,
'torus': createTorus
'cube': createCube,
'sphere': createSphere,
'torus': createTorus
},
ready: ready
});
Expand Down Expand Up @@ -50,9 +50,11 @@

function ready(firstInstance) {
if (firstInstance) {
var popupShowCube = sceneSync.instantiate('cube', {
color: 'white',
position: {x: 0, y: -512, z: 0}
altspace.getEnclosure().then(function (enclosure) {
sceneSync.instantiate('cube', {
color: 'white',
position: {x: 0, y: -enclosure.innerHeight / 2, z: 0}
});
});
}
}
Expand All @@ -64,7 +66,7 @@
});
}
return { awake: awake };
};
}

function getFullUrl(path) {
var currPath = location.pathname;
Expand Down

0 comments on commit c27ea0c

Please sign in to comment.