[resolved] The list of variables and their values

  • Hello

    Sorry for broken English. This post is written with the help of Google-Translator.

    My task:
    Divide the control code, and all texts (titles hotspots, the names of panoramas, etc.)

    Examples:

    Code
    <hotspot name="hs_01"   devices="all"
    	onhover="showtext(TEXT, hs_name_style);"
       />
    ...
    <scene name="scene_01" title="NAME" thumburl="%SWFPATH%/panos/01.tiles/thumb.jpg" >


    I want to put text into a separate file.

    Code
    <include url="%SWFPATH%/skin/text_data_ru.xml" />
    (or <include url="%SWFPATH%/skin/text_data_en.xml" />, etc...)
    ...
    <hotspot name="hs_01"   devices="all"
       onhover="showtext($Hs_text_01, hs_name_style);"
       />
    ...
    <scene name="scene_01" title="$Pano_name_01" thumburl="%SWFPATH%/panos/01.tiles/thumb.jpg" >

    text_data_ru.xml

    Code
    $Hs_text_01="TEXT-1"
    $Hs_text_02="TEXT-2"
    ...
    $Pano_name_01="NAME-01"
    $Pano_name_01="NAME-02"
    ...

    This is in order that would simplify the work on translations, typos, etc.
    A separate file that contains in one place all the used texts - it's very convenient.

    How to do it?

    PS
    I read these threads. But there is described a different functionality. I need the imposition of a separate text file.
    http://www.krpano.com/forum/wbb/inde…d&threadID=9144
    Switching showtext according to chosen language?

  • XML is a markup language and there's no clear definition of "variable".
    How can I create a separate file containing only texts? I'm pretty sure there's a way to do it.


    Working with hundreds and thousands lines disseminated across the files with scenes is kinda disaster.

  • if you are holding your data in text files or in database etc, in my opinion:

    1- You can create a script to create xml dynamically up to your data, there are various ways to create xml strings and adding elements into them.
    2- You can get your data and programmatically create panorama/hotspots/buttons or add panoramic pictures etc. I don't know action script much but even in javascript you can do it easily. I saw in some topics, people suggest action script because of performance benefits. Which way you feel comfortable you can choose.

    To be honest krpano's api documentation is really good one and you can find whatever you want to do in it.

    Edit: For example, let's say you have millions of hotspots and thousands of pictures. You don't have to set xml file for every picture, you just can get these data dynamically from your source (or write there dynamically) use them whenever you need and add them to panoramic views in programmatic way.

    addHotspot(+variableNameHere+);
    hotspot[+variableNameHere+].point[0].ath = variableAthHere..... etc. Code syntax might have flaws but in this way you will only write one function or so to save or load your panoroma data.

    Edit2: in short you are not limited with xml files, you can also use krpano in programmatic way. Check this out: https://krpano.com/docu/quickref/#top https://krpano.com/docu/actions/#top

  • Read again:
    http://www.krpano.com/forum/wbb/inde…45820#post45820

    and in your case this part of definition

    Code
    <language name="german">	<text name="spot0" value="Hallo" />
    	<text name="spot1" value="Du" />
    	...
    </language>
    
    
    <language name="english">
    	<text name="spot0" value="Hello" />
    	<text name="spot1" value="You" />
    	... </language>


    store in separate xml file that you include as you wrote.
    This is the way I also use.

  • Understood. Everything is working.
    Thank you all for the tips.

Participate now!

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