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

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

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




I tried to use(in JS plugin):

Source code

1
plugin.sprite.style.width;


, but failed.


*attention* Thinks for any help!

2

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

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

Source code

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