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

Friday, September 16th 2016, 10:14am

How to show this html text field?

I have placed this code in a scene to have a Title (Lighthouse) show up.

Source code

1
	<layer name="infotext" url="%SWFPATH%/plugins/textfield.swf" background="false" css="color:#FFFFFF;font-weight:bold;font-size:14px;" textshadow="1.0" enabled="false" align="topleft" y="1%" x="1%" html="Lighthouse" />


If I already named the scene title as "Lighthouse" at the start of the scene code, could it be possible to have the html line show the scene title automatically instead of having to include the "Lighthouse" text ? e.g html="%scenetitle% or an action like:

scene[get(xml.scene)].title ); )

(I dont know coding; just trying to pass the idea)

Taurus

Trainee

Posts: 137

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

2

Friday, September 16th 2016, 10:58am

Hi, try to do so

Source code

1
<layer name="infotext" ... onloaded="copy(html, scene[get(xml.scene)].title)" ...

or

Source code

1
<layer name="infotext" ... onstart="copy(html, scene[get(xml.scene)].title)" ...

or

Source code

1
<layer name="infotext" ... html="get:scene[get(xml.scene)].title" ...
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.19pr16

3

Friday, September 16th 2016, 11:28am

Hi Taurus,

This works beautifully well!

Thanks a lot.

4

Sunday, September 18th 2016, 10:22am

Hi Taurus,

to extend the application of this function a little further, how would it be possible to include this line of code in the vtourskin.xml in order to apply the appearance of this text across all the scenes?

Taurus

Trainee

Posts: 137

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

5

Sunday, September 18th 2016, 11:00am

Hi,
I do not know, because I do not use vtourskin

layer "infotext" you need to move out of the scene and to make common to all scenes - and you get what you want

and you need to add this code

Source code

1
2
3
<events name="infotext" keep="true"
onnewscene="copy(layer[infotext].html, scene[get(xml.scene)].title)"
/>
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.19pr16

6

Sunday, September 18th 2016, 12:22pm

Working Great Now!

Anyone who wants to implement this function, try it.

After what Taurus posted, just add keep="true" to the infortext layer also.

Thanks Taurus!