You are not logged in.

1

Monday, May 11th 2020, 3:57pm

Layer Display BUG

I found a problem with the display of the layer,the layer will show after the scene load finish.this is a bug?

When i open the vtour,i will first see black backgroud color and then see the scene ,the last see the layer.

1.bgcolor
2.scene
3.layer

But this is not what i want.I want first see the layer,after click will see scene.
1.bgcolor
2.layer
3.click-->layer-->scene

this is my code

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
	<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" zorder="99" onclick="set(x,-3000)/>
	
	<scene name="scene_pano" title="pano" onstart="" thumburl="panos/pano.tiles/thumb.jpg" lat="" lng="" heading="">

		<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/pano.tiles/preview.jpg" />

		<image>
			<cube url="panos/pano.tiles/pano_%s.jpg" />
		</image>

	</scene>


attachments is my frame-by-frame recording
arielei has attached the following images:
  • sshot-1.png
  • sshot-2.png

This post has been edited 2 times, last edit by "arielei" (May 12th 2020, 5:18am)


2

Tuesday, May 12th 2020, 5:33am

I test set layer type is container,it is ok.

Source code

1
<layer name="load_test_container" type="container" height="100%" width="100%" bgcolor="0x000000" bgalpha="1" keep="true" zorder="99" onclick="set(x,-3000)" bgcapture="true"/>


if layer type is image,it will caused this bug.it's will show adout 10+ ms scene

below code also caused this bug

Source code

1
2
3
<layer name="load_test_container" type="container" height="100%" width="100%" bgcolor="0x000000" bgalpha="0" keep="true" zorder="99">
	<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" onclick="set(x,-3000)"/>
</layer>

3

Tuesday, May 12th 2020, 8:09am

an image has to be loaded first, so this is totally normal and happens on every website.

if you want everything appear at the same time
you can create an overlay and fade it out after everything is ready

4

Tuesday, May 12th 2020, 8:46am

Source code

1
2
3
<layer name="load_test_container" type="container" height="100%" width="100%" bgcolor="0x3c6b05" bgalpha="1" keep="true" zorder="99">
	<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" onclick="set(x,-3000)"/>
</layer>


this is my use code,it not perfect.i set container's bgcolor like image's bgcolor.

i still want get some way to solution this issue.


*smile* Hi indexofrefraction,i try it,but no effect

Source code

1
2
3
4
5
6
7
<layer name="load_test_container_overlay" type="container" height="100%" width="100%" bgcolor="0x000000" bgalpha="1" keep="true" zorder="100"/>

<events name="remove_overlay" keep="true" onloadcomplete="set(layer[load_test_container_overlay].alpha,0)"/>

<layer name="load_test_container" type="container" height="100%" width="100%" bgcolor="0x000000" bgalpha="0" keep="true" zorder="99">
	<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" onclick="set(x,-3000)"/>
</layer>

5

Tuesday, May 12th 2020, 10:33am

events onloadcomplete does not wait for your image
https://krpano.com/docu/xml/#events.onxmlcomplete

you must use your layers onload event

Source code

1
2
<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" onclick="set(x,-3000)"
     onloaded="set(layer[load_test_container_overlay].alpha,0)" />

https://krpano.com/docu/xml/#layer.onloaded

if you have multiple images you must use a counter for each image : onloaded="inc(mycounter)"
and then an onstart action callwhen(mycounter GE 5, set(layer[load_test_container_overlay].alpha,0));

6

Tuesday, May 12th 2020, 11:50am

use layers onload event also have about 7ms scene

thank you indexofrefraction,i have to use delayedcall to fix it.

Source code

1
<layer name="layer_load_test" url="layertest.jpg" keep="true" visible="true" height="100%" width="100%" safearea="false" onclick="set(x,-3000)" onloaded="delayedcall(0.1,set(layer[load_test_container_overlay].alpha,0));"/>


now look like perfect
arielei has attached the following images:
  • sshot-3.png
  • sshot-4.png

7

Tuesday, May 12th 2020, 12:19pm

delayedcall may work on first view, but you cant know the loading time... it can be way longer on a mobile
but layer onloaded (for image layers) should work, it triggers when the image is loaded

ps ... can you see 7ms ? *smile*

This post has been edited 1 times, last edit by "indexofrefraction" (May 12th 2020, 1:14pm)


8

Tuesday, May 12th 2020, 1:57pm

LOL...Screen to Gif ,recording screen,about 7ms,more or less

so delayedcall 100ms is ok,no scene/screen flash cross *tongue*

but also hope klaus.krpano fix it or give some advice.now just like perfect,it not perfect.

This post has been edited 1 times, last edit by "arielei" (May 12th 2020, 2:25pm)