Hi all,
i'm building a virtual tour with krpano (great work btw !). I have to load krapno into a bigger application. So, i use the as3 interface. It just works fine to load pano and command it.
I now just need to create my own swf hotspots. I started with a test (just a red circle)
Code
package kr_plugins.textHotspot
{
import flash.display.Sprite;
import flash.events.DataEvent;
import flash.events.Event;
public class Main extends Sprite
{
private var krpano:krpano_as3_interface;
private var plugin_path:String;
private var plugin_object:Object;
//--------------------------------------------------------------------------------
// CONSTRUCTEUR
//--------------------------------------------------------------------------------
public function Main()
{
if (stage == null) {
this.addEventListener(Event.ADDED_TO_STAGE, _addedToStage)
}
}
/**
* le hotspot a été chargé
* @param e
*/
private function _addedToStage(e:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, _addedToStage);
this.krpano = krpano_as3_interface.getInstance();
//this.krpano.trace(krpano_as3_interface.ERROR, 'pouet');
this.krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, _registerEvent);
this.graphics.beginFill(0xFF0000);
this.graphics.drawCircle(5, 5, 10);
}
private function _registerEvent(evt:DataEvent):void
{
plugin_path = evt.data;
plugin_object = krpano.get(plugin_path);
trace (plugin_path);
trace (plugin_object);
}
}
}
Alles anzeigen
The hotspot is loaded in an other class with
Code
// chargement du pano
this._krpano.call("loadPano('" + vURLXML + "')");
this._krpano.set('area.height', this._stage.height);
// création du hotspot
this._krpano.call("addhotspot(hotspot1);");
this._krpano.set("hotspot[hotspot1].url", GXML.getPath("krpano.plugins") + "textHotspot.swf");
this._krpano.set("hotspot[hotspot1].ath", "18");
this._krpano.set("hotspot[hotspot1].atv", "10");
everything is quite perfect
BUT...
the position of the hotspot in the pano is not fixed. It moves depending the look position.
I certainly miss a parameter or made something wrong, but i just can't find where...
Here is my xml
Code
<krpano version="1.0.8" ispartialpano="true">
<include url="skin/defaultskin.xml" />
<view hlookat="0" vlookat="0" fovmax="90" maxpixelzoom="1.0" limitview="range" vlookatmin="-90" vlookatmax="90" />
<display details="22" />
<preview type="CUBESTRIP" url="salon_marechaux.tiles/preview.jpg" />
<image type="CUBE" multires="true" tilesize="579">
<level tiledimagewidth="3183" tiledimageheight="3183">
<left url="salon_marechaux.tiles/l3_l_%0v_%0h.jpg" />
<front url="salon_marechaux.tiles/l3_f_%0v_%0h.jpg" />
<right url="salon_marechaux.tiles/l3_r_%0v_%0h.jpg" />
<back url="salon_marechaux.tiles/l3_b_%0v_%0h.jpg" />
<up url="salon_marechaux.tiles/l3_u_%0v_%0h.jpg" />
<down url="salon_marechaux.tiles/l3_d_%0v_%0h.jpg" />
</level>
<level tiledimagewidth="1592" tiledimageheight="1592">
<left url="salon_marechaux.tiles/l2_l_%0v_%0h.jpg" />
<front url="salon_marechaux.tiles/l2_f_%0v_%0h.jpg" />
<right url="salon_marechaux.tiles/l2_r_%0v_%0h.jpg" />
<back url="salon_marechaux.tiles/l2_b_%0v_%0h.jpg" />
<up url="salon_marechaux.tiles/l2_u_%0v_%0h.jpg" />
<down url="salon_marechaux.tiles/l2_d_%0v_%0h.jpg" />
</level>
<level tiledimagewidth="796" tiledimageheight="796">
<left url="salon_marechaux.tiles/l1_l_%0v_%0h.jpg" />
<front url="salon_marechaux.tiles/l1_f_%0v_%0h.jpg" />
<right url="salon_marechaux.tiles/l1_r_%0v_%0h.jpg" />
<back url="salon_marechaux.tiles/l1_b_%0v_%0h.jpg" />
<up url="salon_marechaux.tiles/l1_u_%0v_%0h.jpg" />
<down url="salon_marechaux.tiles/l1_d_%0v_%0h.jpg" />
</level>
</image>
</krpano>
Alles anzeigen
Thanks for you help !