It is possibile to scale plugins or hotspots not proportionally?
For example :
set(plugin[name].scalex, 0.5) ;
set(plugin[name].scaley, 1);
?
Thanks
It is possibile to scale plugins or hotspots not proportionally?
For example :
set(plugin[name].scalex, 0.5) ;
set(plugin[name].scaley, 1);
?
Thanks
You have to use width and height, x and y is only for position
set(plugin[name].width, 100) ;
set(plugin[name].height, 200);
With width and height you can set absolute value or relative to screen, right?
I want to scale the plugin of 50% of his size only in his width, for example, and 100% of his height.
Yes you can set width 50% and height 200 (pixels) for example.
But no way to set hor and vert scale value.
Andrey
Hi,
I want to scale the plugin of 50% of his size only in his width, for example, and 100% of his height.
when using percent values, then these values will be relative to the parent, or the screen (when there is no parent),
to scale a plugin to a relative values from its own source size, some code can be used,
the imagewidth/imageheight variables from a plugin or hotspot element are containing the source image size,
so they can be used to scale an image relative to it's own size,
see here the imagewidth/imageheight documentation:
https://krpano.com/docu/xml/#plugin.imagewidth
e.g. to set 'scalex' to 0.5 and 'scaley' to 1.0:
or to animate/tween it:
mul(new_width, imagewidth, 0.5);
tween(width, get(new_width));
mul(new_height, imageheight, 1.0);
tween(height, get(new_height));
or use that code in an universal action (for calling from plugin/hotspot events):
<action name="scaleto">
<!-- 1. parameter = x scale, 2. parameter = y scale -->
mul(new_width, imagewidth, %1);
tween(width, get(new_width));
mul(new_height, imageheight, %2);
tween(height, get(new_height));
</action>
best regards,
Klaus
Don’t have an account yet? Register yourself now and be a part of our community!