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.

1

Saturday, December 14th 2013, 7:12pm

Autorotate Button Problem

Hi!
I'm trying to create an autorotate button that stops/restart the autorotation with text and button changing. Here's the code I wrote:

On main XML:
<autorotate enabled="true" waittime="1.5" speed="4.0" />

On vtourskin XML:
<layer name="skin_btn_rotate" style="skin_glow" url="red_button/button-rotate_dis_red.png" align="bottom" y="5" x="-55" scale="0.7" alpha="1.0"
onclick="autorotate_btn_events(); switch(autorotate.enabled);"
onhover="if(autorotate.enabled, showtext(disable autorotation, hovertext), enable autorotation, hovertext));"
/>

<plugin name="autorotate_btn"
onautorotateenabled="set(layer[skin_btn_rotate].url, button-rotate_dis_red.png);"
onautorotatedisabled="set(layer[skin_btn_rotate].url, button-rotate_en_red.png);"
/>

<textstyle name="hovertext"
background="false" border="false" textalign="center" font="Helvetica" fontsize="14" textcolor="0xFFFFFF" effect="glow(0xFFFFFF,0.3,2,1);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>

The code works good on text hovering and stop/restart autorotation, but does not work on BUTTON CHANGING. Is there other solution to resolve this problem?
Please have a look at the attachment
Can somebody help me?

Regards,
Don
dond2222 has attached the following image:
  • autorotate button.JPG

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

2

Saturday, December 14th 2013, 9:58pm

next time please give live link or attach the code with images.

Replace your code with this:

Source code

1
2
3
4
5
6
7
8
9
10
11
<layer name="skin_btn_rotate" style="skin_glow" url="red_button/button-rotate_en_red.png" align="bottom" y="5" x="-55" scale="0.7" alpha="1.0" 
onclick="autorotate_btn_events(); switch(autorotate.enabled);" 
onhover="if(autorotate.enabled, showtext(disable autorotation, hovertext),showtext(enable autorotation, hovertext));"/>	

<action name="autorotate_btn_events">		
switch(layer[skin_btn_rotate].url, skin/red_button/button-rotate_dis_red.png, skin/red_button/button-rotate_en_red.png);	 
</action>

<textstyle name="hovertext"
background="false" border="false" textalign="center" font="Helvetica" fontsize="14" textcolor="0xFFFFFF" effect="glow(0xFFFFFF,0.3,2,1);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>

3

Sunday, December 15th 2013, 1:03pm

Thanks Anton@ It works perfectly!

Regards,
Don

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

4

Sunday, December 15th 2013, 2:15pm

*thumbup*