Hi,
I am making a gui plugin for adding hotspots and linking panoramas that saves to a database.
So far i can create image hotspots but i don't know how to create a polygon hotspot.
I wasn't able to find how to do it in the docs or on the forum.
Hi,
I am making a gui plugin for adding hotspots and linking panoramas that saves to a database.
So far i can create image hotspots but i don't know how to create a polygon hotspot.
I wasn't able to find how to do it in the docs or on the forum.
Hi hrvoje_86,
Quotebut i don't know how to create a polygon hotspot.
By defining the coordinates of the polygonal hotspot points: hotspot[name].point[..].ath
SAlut.
Thanx for the reply i made this function but it doesn't seem to create a polygon.
Am i missing something?
// polyspot
function addGoSpot(e:MouseEvent)
{
highestN++
var N = highestN
selected_hs = "hs"+N
krpano.call("addHotSpot("+selected_hs+")")
krpano.set("hotspot["+selected_hs+"].scale", 0.7);
krpano.set("hotspot["+selected_hs+"].zoom", true);
krpano.set("set(hotspot["+selected_hs+"].fillalpha", 0.25);
krpano.set("set(hotspot["+selected_hs+"].borderalpha", 0.50);
krpano.set("set(hotspot["+selected_hs+"].point[0].ath",-50);
krpano.set("set(hotspot["+selected_hs+"].point[0].atv",-50);
krpano.set("set(hotspot["+selected_hs+"].point[1].ath",-50);
krpano.set("set(hotspot["+selected_hs+"].point[1].atv",+50);
krpano.set("set(hotspot["+selected_hs+"].point[2].ath",+50);
krpano.set("set(hotspot["+selected_hs+"].point[2].atv",+50);
krpano.set("set(hotspot["+selected_hs+"].point[3].ath",+50);
krpano.set("set(hotspot["+selected_hs+"].point[3].atv",-50);
krpano.set("h",0)
krpano.set("v",0)
krpano.call("screentosphere(mouse.x,mouse.y,h,v)")
hs = getSprite(selected_hs)
//hs.addEventListener(MouseEvent.CLICK,endMove)
//addEventListener(Event.ENTER_FRAME, onMove)
// hs info
hs_box.selected_hs.text = selected_hs
hs_total++
}
Display More
I am sorry to not be of help, but I know nothing about AS3 ...
SAlut.
I'm still stuck at this.
I would appreciate some help.
Hi,
adding the hotspot via addhotspot() and setting the points should be normally enough,
but you code is bit wrong,
see here the two set:
Quotekrpano.set("set(hotspot["+selected_hs+"].fillalpha", 0.25);
either do this - calling the set() xml action - that means the full set action as string as parameter of the call function:
Quotekrpano.call("set(hotspot["+selected_hs+"].fillalpha, 0.25);");
or do that - directly set the variable via the krpano set interface function: (recommended! better because faster)
Quotekrpano.set("hotspot["+selected_hs+"].fillalpha", 0.25);
best regards,
Klaus
Thank you!
How do i remove 1 point from the hotspot?
Hi,
that's more complicated,
either by first copying all elements above the point index that should be deleted one index down,
and then decreasing the count setting about one value,
or by getting the internal array and calling the removeItem() function from it,
e.g.
var hotspotspointsarray:Object = krpano.get("hotspot[name].point");
hotspotspointsarray.removeItem(index);
best regards,
Klaus
Don’t have an account yet? Register yourself now and be a part of our community!