You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, January 4th 2019, 3:32pm

Handle krpano event inside own plugin

Hi!

I'm working on my own plugin and I encountered a problem. I would like to handle krpano events like 'onnewpano, onloadcomplete etc.' How can i do that ? Is this possible?

Greetings!

Mael B.

Trainee

Posts: 126

Location: France, Montpellier

  • Send private message

3

Friday, January 4th 2019, 5:13pm

Hi,

here a full example:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local.registerplugin = function(krpanointerface, pluginpath, pluginobject)
{
   krpano = krpanointerface;
   plugin = pluginobject;

   ...

   // create a new <events> element with a name based on the plugins name
   var events = krpano.events.createItem(plugin.name + "_events");
   
   // use the same keep setting as the plugin
   events.keep = plugin.keep;

   events.onnewpano = function()
   {
     ...
   }

   events.onloadcomplete = function()
   {
     ...
   }

   ...

}


Best regards,
Klaus

4

Monday, January 7th 2019, 3:55pm

I meant handle (catch, capture event when was fired) but i solved my problem.

Thanks for reply! :)