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.

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

1

Monday, December 19th 2016, 10:16am

responsive design with stagescale

Hi,
I found mul(stagescale,x); could be very helpful with responsibility of VT design

recently I am using something like that:


<action name="resizing">
if((stageheight LE 800) AND (stageheight GT600), mul(stagescale,0.8););
if((stageheight LE 600) AND (stageheight GT 500), mul(stagescale,0.6););
if((stageheight LE 500), mul(stagescale,0.5););
</action>

it works fine when loading the tour, but it doesn´t work if I turn the tablet or smartphone from e.g. desktop orientation to portrait one. For that I tried to put this action to
even onresize:


<events onresize="resizing();" />


But when doing this, seems that the mul action will take effect each time when I load new panorama in the tour and the siye of my layout shrinks each time *wacko*


I tried to use instead of math operator mul(stagescale,0.8); action set(stagescale,0.8); but this unfortunately does not work *sad* (Excuse my ignorance if this doesn´t have any logic for you, I´m not really a programmer *tongue* ).

Does anybody have an idea how to overcome this problem? I just simply want to have some exact scaling with particular stageheight. How to do that?
Thanx for the help!
Best regards,
Igor Socha

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Monday, December 19th 2016, 10:38am

Hi)

Strange that

Source code

1
set(stagescale, 0.8);
doesn't work... I've just tried it and it works here for me.
Regards,

Alexey

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

3

Monday, December 19th 2016, 10:46am

really? so I´m doing something wrong somewhere!
thanx for testing, I´m going to take a look
Best regards,
Igor Socha

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

4

Monday, December 19th 2016, 10:52am

uff I´m sorry, I tried it few days ago and it was not working, returned to it today and it works!

however i found another problem with my approach - now I can use my action as onresize event and it works with downscaling but not the oposite way *confused*
Best regards,
Igor Socha

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

5

Monday, December 19th 2016, 11:01am

Here I found some stagescale testing example:
https://krpano.com/examples/116/examples…scale-test.html

and by changing the stagescale also the stagesize is changing.
According to what I see in this example, it seems that if I have e.g. full HD monitor 1920x1080px, by using e.g. set(stagescale, 0.5); now krpano considers it as double resolution, right? So this is why my code works for downscaling but not in opposite direction?
Best regards,
Igor Socha

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

6

Monday, December 19th 2016, 11:05am

Hmm what should I do to make it work? Is there any way how to get real resolution of the display in krpano, or I should better use javascript for that ?
Best regards,
Igor Socha

7

Monday, December 19th 2016, 5:53pm

<events onresize="resizing();" />

is not correct krpano code

correct would be :

<events name="my_great_resize_event" keep="true" onresize="resizing();" />

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

8

Monday, December 19th 2016, 6:19pm



is not correct krpano code

correct would be :

no no, there are two types of events:

  • The global krpano events
These are the events that were defined in <events> elements without a name attribute. There can be always only one global event. When there is another <events> element in the xml with the same events the previously defined events were overwritten.

Note - when loading an other xml file or another scene, all global events will remain and be unchanged unless they are defined again in the new xml or scene.

  • Independent local krpano events
When an <events> element in the xml will be defined with a name attribute - then this will be an independent events element.
It can contain any of the events, but they will not overwrite the global events, they will be called additionally to it.
These 'named' <events> elements have also a keep attribute (with the default value "false"). That means <events> elements without keep="true" will be automatically removed when an other pano will be loaded.


http://krpano.com/docu/xml/#events
Best regards,
Igor Socha