-
Notifications
You must be signed in to change notification settings - Fork 9
Code Examples
Dalí edited this page Sep 25, 2017
·
17 revisions
Image | title/link | Description | Contributor(s) |
---|---|---|---|
code_example | ShowCase New Features | Hjalmar Snoep |
function panoramaEnable() {
// Als op de button wordt geklikt:
if(panoSphere.getSphereMode()==true)
{
panoSphere.setSphereMode(false);
document.getElementById("sphereButton").innerHTML ='Zet SphereModus aan' ;
} else
{
panoSphere.setSphereMode(true);
document.getElementById("sphereButton").innerHTML ='Zet SphereModus uit' ;
}
Code by: Jesse De jong
Edit by: Dalí Klaassen
panoSphere.setCallback(clickSomething); // zodra de gebruiker klikt, wordt dit aangeroepen.
function clickSomething(richting)
{
console.log("er is geklikt op: "+richting);
panoSphere.popup.show("er is geklikt op: "+richting);
}
Code by: Jesse De jong
Edit by: Dalí Klaassen
function loadLocation(x){
// laat een nieuwe plek zien.
panoSphere.showCustomNode({
front: "img/node"+x+"/front.jpg",
back: "img/node"+x+"/back.jpg",
left: "img/node"+x+"/left.jpg",
right: "img/node"+x+"/right.jpg",
up: "img/node"+x+"/up.jpg",
down: "img/node"+x+"/down.jpg",
});
}
Code by: Jesse De jong
Edit by: Dalí Klaassen
function mouseUpHandler(e)
{
e = e || window.event;
mouse.down = false;
// check if user moved the view!
var dx=mouse.x-mouse.start_x;
var dy=mouse.y-mouse.start_y;
var dist_swiped=Math.sqrt(dxdx+dydy);
//console.log("distance swiped: "+dist_swiped);
if(dist_swiped<20)
{
//console.log("click direction "+mouse.dir);
broadCastEvent({type:"click",data:mouse.dir});
if(callback!=null) callback(mouse.dir);
}
e.preventDefault();
}
Code by: Jesse De jong
Edit by: Dalí Klaassen