Sie sind nicht angemeldet.

1

Dienstag, 10. September 2013, 09:21

Create owner plugin using javascript

Hi,all
I'm a new bie in krpano. I want to make own plugin. I followed in this page

http://krpano.com/docu/plugininterface/#js
but I can't use function like testfunction1(), testfunction2()...
So how I can use it,help me please?
Or let me see how to make and use plugin step by step.
Thanks a lot.
Sory about my english.

2

Mittwoch, 11. September 2013, 16:33

Hi,

note - when writing html5 .js plugins - you need to use the html5 viewer, they will not work in Flash!

To include the plugin itself, just include it in the xml - e.g.

Quellcode

1
<plugin name="yourplugin" url="yourplugin.js" devices="html5" keep="true" ... />


Best regards,
Klaus

3

Freitag, 13. September 2013, 11:09

I download plugintemplate.js in http://krpano.com/docu/plugininterface/#js and include it like you but it doesn't work.

4

Mittwoch, 18. September 2013, 08:26

Hi,

sorry, but just 'doesn't work' is too unspecific to be able to help...

How are you including it? (scenes and keep=true? html5 viewer?)

Best regards,
Klaus

5

Donnerstag, 19. September 2013, 05:33

I have include plugin but I can't call function of that plugin form tour.xml

6

Donnerstag, 19. September 2013, 07:02

I have included plugintemplate.js in to my vtour.
How can I call testfunction1() in plugintemplate.js from tour.xml ?

7

Donnerstag, 19. September 2013, 07:08

Hi,
sorry, but just 'doesn't work' is too unspecific to be able to help...
How are you including it? (scenes and keep=true? html5 viewer?)
Best regards,
Klaus
Yes, I have include like this

8

Mittwoch, 25. September 2013, 08:10

Hi,

look in the example code at the registerplugin function - there the testfunction1 function will be assigned to the plugin object:

Quellcode

1
plugin.testfunction1 = testfunction1;


That means to call this functions from xml, it need to be called from the plugin object.

e.g. when you embed the plugin this way:

Quellcode

1
<plugin name="myplugin" url="myplugin.js" preload="true" devices="html5" />


then it can be called this way:

Quellcode

1
plugin[myplugin].testfunction1();


Best regards,
Klaus