You are not logged in.

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

1

Thursday, December 22nd 2016, 9:33am

buttons scale

Hi all,
I made a tour using v1.18 as a demo for a client.
The tour includes some buttons in the top right corner to navigate between different levels of the building.
I did not include anything in the code to do with scaling on different devices but the buttons automatically scale down to fit when viewed on a mobile... cool!

However, the client asked about webvr, so I re-made the tour using v1.19, used exactly the same plugin code for the buttons but they don't scale on a mobile...?

Where have I gone wrong?

This is the code for the buttons:
plugin name="planta_-1" url="plugins/planta_-1.png" align="top,right" alpha="0.5" scale="0.6" enabled="true"
onover="-1_up();"
onout="-1_down();"
onclick="loadscene(scene_-1_03,null,MERGE,BLEND(1));"

Here's the links to the two tours:

v1.18

v1.19

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

2

Saturday, December 24th 2016, 4:19pm

Ok... I've had no response to this so I it's either that it's a question so stupid that it doesn't warrant any response *wacko* or, it's too near to Christmas and everyone is out getting drunk!
I prefer to think the latter *smile*

Anyway, my client has been pushing to see some results so, for any one that's interested (and not out getting drunk!), here's my work around.

First I reduced the size of my plugins so I didn't have to include ´scale="0.6"` just in case this was causing any conflict within the code from, for example vtourskin.xml.... but it made no difference.

So I made a blank .png holder the exact size of my 4 buttons and added the following to the main xml:

<krpano mydevicecheck="true" devices="iphone|mobile"/>

<plugin name="holder" url="plugins/holder.png" keep="true" align="topright" scalechildren="true"
onloaded="if(mydevicecheck,mul(scale,0.5));"
altonloaded="if(mydevicecheck,mul(scale,0.5));"
/>

Then adjusted my buttons code to:

<plugin name="planta_-1" url="plugins/level_-1.png" align="top" parent="holder" alpha="0.5" enabled="true"
onover="-1_up();"
onout="-1_down();"
onclick="loadscene(scene_-1_03,null,MERGE,BLEND(1));"
/>

<plugin name="planta_baja" url="plugins/ground.png" align="top" parent="holder" y="67" alpha="1" enabled="false"
onover="baja_up();"
onout="baja_down();"
/>

<plugin name="planta_1" url="plugins/level_1.png" align="top" parent="holder" y="134" alpha="0.5" enabled="true"
onover="up1()"
onout="down1()"
onclick="loadscene(scene_01_01,null,MERGE,BLEND(1)); "
/>

<plugin name="planta_2" url="plugins/level_2.png" align="top" parent="holder" y="201" alpha="0.5" enabled="true"
onover="up2()"
onout="down2()"
onclick="loadscene(scene_02_00,null,MERGE,BLEND(1)); "
/>

This has sorted out the scaling issue on the mobile and my client is happy.
I know this is probably not the correct way to achieve what I needed but, it works until I can find out another way.

Happy holidays *thumbsup*

3

Friday, December 30th 2016, 9:36am

Hi,

look in the html file for the 'mobilescale' setting:
http://krpano.com/docu/html/#mobilescale

or in the xml for the stagescale setting:
http://krpano.com/docu/actions/#stagescale

The default is 0.5 for mobiles, but the default html templates and the vtourskin.xml from version 1.19 are defining it to be 1.0 (because the new vtourskin layout is designed for that scale).

Best regards,
Klaus

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

4

Saturday, December 31st 2016, 12:18pm

Thanks Klaus,

I did try playing with the stage scale setting in the vtourskin.xml and, yes, the buttons were smaller on mobile but there was a large space between each of them.
I assume this is because I have specified a y-axis position.

I also tried making each button a child of the one above to try to get them to 'stick' together, but was unsuccessful.

As I have indicated previously (in other posts), my coding skills are quite limited so, for sure, I've done something wrong somewhere.

Anyway, although not ideal, the solution I came up with works and my client is happy.

Thanks again for your response and a Happy New Year!