You are not logged in.

Dear visitor, welcome to 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.


Tuesday, September 5th 2017, 11:58am

How to get the pixel size at the beginning of the JS plugin

Hello All
*question* How to get the pixel size of the plugin.sprite at the beginning of the plugin?

(in krpano xml):

Source code

<layer name="mylayer"	...	width="-320"	height="50%"	.../>

I tried to use(in JS plugin):

Source code


, but failed.

*attention* Thinks for any help!


Sunday, September 10th 2017, 6:06pm

Great! It's settled!
First, you can't get the pixel size of "plugin.sprite.width" in the

Source code

local.registerplugin = function(krpanointerface, pluginpath, pluginobject) {  krpano.trace(1, plugin.sprite.width);}
you can then get it in

Source code

local.onresize = function(width,height){  krpano.trace(1, width);}
So, you can handle its subelement size according to the pixel size of "plugin.sprite".