How to hide scrolling textfield on pano load

  • Hello,

    I am trying to have the scrolling textfield hidden on pano load. I am testing using the tour_testingserver and what I tried was in this part of the code:


    <action name="CheckTxt">
    if(scene[get(xml.scene)].txt,
    scene[get(xml.scene)].txt();
    set(layer[showtext].visible, true);
    ,
    set(layer[showtext].visible, false);

    );
    </action>

    I tried changing the "set(layer[showtext].visible, true);" to "false", but it still shows when the pano loads.

    Thanks for any help!

  • Hi Tuur,

    Thank you so much for your response. Long time no talk. I hope you’ve been well.

    Here is the link to my tour:

    https://www.jeremyfukunaga.com/360-degree/coh…house/tour.html


    I would like the scrolling text window to appear after one clicks on the intro screen and enters the tour, or just be hidden on load, and then one could click on the info button to open it. The first option would be the best one think.

    Thank you again for your response and help.

  • jeremyfukunaga-san.

    I hope this will give you a hint. *squint*

    Code
    <layer xxx onclick="open_scroll();" />
    	<action name="open_scroll">		set(layer[scroll_text_back].visible,true);set(layer[scroll_text_1].visible,true);	</action>
    <scene xxx onstart="set(layer[scroll_text_1].html,data:html_test1)" >
    		<layer name="scroll_text_back" type="container" bgcolor="0xEA574D" bgalpha="0.3" width="100%" height="30px" keep="true" visible="false" />		<layer name="scroll_text_1" type="text" style="scroll_text" html="" keep="true"  visible="false" />		<style name="scroll_text" type="text" align="top" x="" y="-2" width="100%" bg="false" enabled="false" />
    		<data name="html_test1">				<style type="text/css">				.scroll {				  margin     : auto;				  width      : 100%;				  font-size  : 120%;				  line-height: 2.4em;				  text-align : center;				  border     :  ;				  color      : #ffffff;				  background-color: rgba(2, 0, 5, 0);				  overflow   : hidden;				}				.scroll span{				  display     : inline-block;				  padding-left: 100%;				  white-space : nowrap;				  line-height : 1em;				  animation   : scrollAnime 30s linear infinite;				}				@keyframes scrollAnime{				    0% { transform: translateX(0)}				  100% { transform: translateX(-100%)}				}				</style>
    				<div class="scroll">				  <span>[img src="./image/xxx.svg" height=17px ]<bold>test1.test1.test1.test1</bold></span>				</div>		</data>
    </scene>
  • Hi,

    I think (?) the problem is here in the onnewscene event.. which is also called on the first pano (!).

    Code
    <events name="scrolltxt" keep="true" onnewscene="CheckTxt"/>

    perhaps first change that to:

    Code
    <events name="scrolltxt" keep="true" onnewscene=""/>

    then maybe try in hide_introscreen action to add:

    CheckTxt();
    events[scrolltxt].onnewscene = 'CheckTxt();';

    or so..

    Tuur *thumbsup*

  • Thank you,Tuur. I did try removing the CheckTxt already and it does remove it, but I am unable to open it again with the button I have to open and close it. I click the button and it does nothing.

    I tried to incorporate the other code into the hide_introscreem, but I was unsuccessful. Could you provide a little more guidance?


    <action name="hide_introscreen">
    if(device.mobilevr AND webvr.isavailable,
    <!-- on vr-devices like the Oculus Go or Oculus Quest directly enter the VR mode -->
    removeplugin(blur);
    stoptween(layer[introscreen].bgalpha);
    removelayer(introscreen,true);
    set(layer[tour_ui].alpha,1.0);
    webvr.enterVR();
    ,
    set(layer[introscreen].enabled,false);
    tween(layer[introscreen].bgalpha|layer[introscreen].alpha|plugin[blur].range, 0.33|0.0|0.0, 1.0, default,
    removeplugin(blur);
    removelayer(introscreen,true);
    );
    tween(layer[tour_ui].alpha,1);
    );
    </action>


    Thank you again!

  • Thanks, Tuur. I was able to get that to work and everything seems to be working fine now.

    The working updated code:


    <action name="hide_introscreen">
    if(device.mobilevr AND webvr.isavailable,
    <!-- on vr-devices like the Oculus Go or Oculus Quest directly enter the VR mode -->
    removeplugin(blur);
    stoptween(layer[introscreen].bgalpha);
    removelayer(introscreen,true);
    set(layer[tour_ui].alpha,1.0);
    webvr.enterVR();
    ,
    set(layer[introscreen].enabled,false);
    tween(layer[introscreen].bgalpha|layer[introscreen].alpha|plugin[blur].range, 0.33|0.0|0.0, 1.0, default,
    removeplugin(blur);
    removelayer(introscreen,true);
    );
    tween(layer[tour_ui].alpha,1);
    );

    CheckTxt(); // Add this line to call CheckTxt();
    events[scrolltxt].onnewscene = 'CheckTxt();'; // Add this line to set the event handler
    </action>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!