• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 Is it possible..... Stack string on another string in same code block?

Messages
10,163
Country
us-arizona
Hey all,

What I have;
Gray font, says 'Item'. Click it, it turns green, says 'Check'. Gray to Green during 'click'.

What I want;
Gray font, says 'Item'. Click it, 'Check' turns on in Green, but hovers over the Gray font that says 'Item'. You would see both, Gray is under the Green,
Green appears to be hovering over or on top of Gray, you can still partically read the Gray under the Green.

Question; Can this be done in a single code block? Two strings on top of each other?

This is what I have;

Code:
// ROW THREE
   <Element>
      <Element>
          <Position X="84" Y="260"/> 
    <FormattedText X="700" Y="374" Font="Arial Black" FontSize="26" LineSpacing="32" Adjust="Left" Color="#999999" Bright="Yes">
          <Color Value="#0X00FF00"/>
      <String>
        %((L:CHECKLIST STARTUP THREE,bool) 0 ==)
        %{if}
        %CAPACITORS ON
        %{else}
        %\{clr2}
        %CHECK
      </String>
         </FormattedText>
      </Element>
      </Element>



This is in FS2004 XML code format.
 
Yes it can but with 2 elements and the use of visibility (background color must be black - 0,0,0 - transparent - default).
Once visibility is used with text strings double elements must be used to keep the string loaded.
Plus I would advise to use proper XML comments.. "//" or ";" are not any of them - <!-- COMMENT -->, <Comment> COMMENT </Comment> are proper.
The gauge may load using improper comments but........

XML:
<!-- ROW THREE BACKGROUND -->
<Element>
    <Visible>(L:CHECKLIST STARTUP THREE,bool) 0 !=</Visible>
        <Element>
            <Position X="84" Y="260"/>
                <FormattedText X="700" Y="374" Font="Arial Black" FontSize="26" LineSpacing="32" Adjust="Left" Color="Grey" Bright="Yes">
                    <String>
                        %ITEM
                    </String>
                </FormattedText>
        </Element>
</Element>


<!-- ROW THREE FOREGROUND -->
<Element>
    <Visible> SOME CODE THAT REFLECTS THAT THE ITEM IS CURRENTLY BEING CHECKED OR HAS BEEN CHECKED  ("ITEM" HAS BEEN CLICKED")</Visible>
        <Element>
            <Position X="84" Y="260"/>
                <FormattedText X="700" Y="374" Font="Arial Black" FontSize="26" LineSpacing="32" Adjust="Left" Color="#999999" Bright="Yes">
                <Color Value="#0X00FF00"/>
                    <String>
                        %((L:CHECKLIST STARTUP THREE,bool) 0 ==)
                        %{if}
                        %\{clr1}
                        %CAPACITORS ON
                        %{else}
                        %\{clr2}
                        %CHECK
                        %{end}
                    </String>
                </FormattedText>
        </Element>
</Element>
 
Last edited:
Many thanks, Roman. I was hoping there was a way to not have to do dual blocks.

It did occur to me, I can write the same font in green, and have on / off written in as well. That cancels out the need for double strings on top of each other. Single purpose strings.

I had thought // was ok. I'll try not to do that anymore. Its been working, and enables me to comment like heck and also I can put in the 'off' strings ( <!-- --> ) when I need to when I am turning of blocks.

After %CHECK there must be an %{end}

No need to double
<Element>
</Element>

In FS2004 XML, when doing fonts, you usually have to do dual element surrounds or the fonts sometimes mysteriously do not show up.
 
In FS2004 XML, when doing fonts, you usually have to do dual element surrounds or the fonts sometimes mysteriously do not show up.

:scratchch say what? Other than the provision involving <Visible> that Roman mentioned, there is no requirement for nested ('double') Elements.
 
Last edited:
After %CHECK there must be an %{end}

No, there must not. It might be, and to keep code well structured, should be. But the script will work without it. I recall to have posted the same clarification in a thread months (years?) ago.

:scratchch say what? Other than the provision involving <Visible> that Roman mentioned, there is no requirement for nested ('double') Elements.

I believe he got confused thinking of the <Visible> issue with string elements, when sometimes they won't refresh as expected. Which is not the case, or wouldn't be, as the formatted string is handling proper refreshment.

It did occur to me, I can write the same font in green, and have on / off written in as well. That cancels out the need for double strings on top of each other. Single purpose strings.

I think it is possible to write one text over the other, if you use tabs in your string definition, and triggers a back tab before the "CHECK" text. But it has to be checked.

Tom
 
I think it is possible to write one text over the other, if you use tabs in your string definition, and triggers a back tab before the "CHECK" text. But it has to be checked.
Was just about to post something similar, would need testing of course.. :)

Nothing tried worked.. It seems in the string there are built in (as in HTML) margins/padding. Tabs, even negative, just push the rest of string over.
 
Last edited:
Code:
 I recall to have posted the same clarification in a thread months (years?) ago.

I remember too!

Code:
to keep code well structured
But i'm doing it this way for years, so i forget it:confused:
 
Thanks anyways guys. Was certainly worth a try.

Odd that it stacks. Code is so odd how the computer finds ways to do things. You think it would do 'this' but instead it does something totally 'that'.
 
Back
Top