You are not logged in.

1

Thursday, February 9th 2012, 1:48pm

Scale X and Y

It is possibile to scale plugins or hotspots not proportionally?
For example :
set(plugin[name].scalex, 0.5) ;
set(plugin[name].scaley, 1);
?

Thanks

2

Thursday, February 9th 2012, 3:09pm

You have to use width and height, x and y is only for position

set(plugin[name].width, 100) ;
set(plugin[name].height, 200);

3

Thursday, February 9th 2012, 3:42pm

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.

mindlessboss

Professional

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

4

Thursday, February 9th 2012, 4:07pm

Yes you can set width 50% and height 200 (pixels) for example.
But no way to set hor and vert scale value.

Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

5

Tuesday, February 14th 2012, 4:35pm

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:
http://krpano.com/docu/xml/#plugin.imagewidth

e.g. to set 'scalex' to 0.5 and 'scaley' to 1.0:

Source code

1
2
mul(width, imagewidth, 0.5);
mul(height, imageheight, 1.0);


or to animate/tween it:

Source code

1
2
3
4
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):

Source code

1
2
3
4
5
6
7
<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

Similar threads