addlayer, only the last is visible...

  • Hello,

    i don't understood why in this code only the last layer is visible and not all.
    Its for text layer from an array call from the button 'DTS'

    my visit is visible here: link

    In this case, only the last layer 'Étang du Stock' is visible.
    All my mayer have a different name, Y position is different, ....
    I trace them :)


    Thanks a lot for your help

  • in your action getBarrage() you forgot :

    addlayer(get(nomBarrage));
    assignstyle(layer[get(nomBarrage)], 'titreBarrageStyle');
    ... etc

    and.. mind that krpano does not distinct cases...
    i wouldnt use names with small and big letters for xml element names (or variables).

    https://krpano.com/docu/xml/#name

  • no, nomBarrage is a variable in this case

    by addlayer(nomBarrage); you create a layer with name="nomBarrage"

    by addlayer(get(nomBarrage)); you create a layer with name="<what is inside the variable nomBarrage>"

    *smile*

    in krpano you need get() to "resolve" a variable
    you will need get() in most functions, except for debug(), trace() and very few other exceptions

    in your example you create 4x the same layer "nomBarrage" so in the end you just have the last iteration

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!