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):

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


    I tried to use(in JS plugin):

    Code
    plugin.sprite.style.width;

    , but failed.


    *attention* Thinks for any help!

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

    Code
    local.registerplugin = function(krpanointerface, pluginpath, pluginobject) {  krpano.trace(1, plugin.sprite.width);}

    And, you can then get it in

    Code
    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".

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!