Page 1 of 1

[SOLVED]problem about format tags

Posted: Mon Dec 26, 2011 07:10
by lixinyiabc123
Hi~
I'm new in using CEGUI and need some helps.
I find format tags don't work with OgreTray skin or some other skins.
The color of Button2 does not change to green with the format code [colour='FF00FF00']Button2
Thank you for help!!! :D

Code: Select all

<GUILayout >
    <Window Type="DefaultWindow" Name="Root" >
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="TaharezLook/Button" Name="Root/bt1" >
            <Property Name="Text" Value="[colour=&apos;FF00FF00&apos;]Button1" />
            <Property Name="UnifiedAreaRect" Value="{{0.0554906,0},{0.0943486,0},{0.305491,0},{0.344348,0}}" />
        </Window>
        <Window Type="OgreTray/Button" Name="Root/bt2" >
            <Property Name="Text" Value="[colour=&apos;FF00FF00&apos;]Button2" />
            <Property Name="UnifiedAreaRect" Value="{{0.0620791,0},{0.380063,0},{0.312079,0},{0.630063,0}}" />
        </Window>
        <Window Type="Vanilla/Button" Name="Root/bt3" >
            <Property Name="Text" Value="[colour=&apos;FF00FF00&apos;]Button3" />
            <Property Name="UnifiedAreaRect" Value="{{0.058126,0},{0.679435,0},{0.308126,0},{0.929435,0}}" />
        </Window>
    </Window>
</GUILayout>

Image

Re: problem about format tags

Posted: Mon Dec 26, 2011 12:19
by pav
What if you set the buttons' "NormalTextColour" (OgreTray) to FFFFFFFF?

Re: problem about format tags

Posted: Mon Dec 26, 2011 12:58
by lixinyiabc123
pav wrote:What if you set the buttons' "NormalTextColour" (OgreTray) to FFFFFFFF?

Thank you very much, the format tag works when i modify OgreTray.looknfeel file. :)
but are there existing some other methods to change text colour without modifying *.looknfeel files ? :?:

Re: problem about format tags

Posted: Mon Dec 26, 2011 14:04
by Kulik
I think in this case CEGUI modulates NormalTextColour with the colour from your formatting. If NormalTextColour is black, the result will always be black.

This has previously been discussed, search! Also look how Ember from Worldforge solves this, they have subclassed FormattedTextParser and just put the final colour there, without modulating it.

Re: problem about format tags

Posted: Mon Dec 26, 2011 17:34
by pav
In addition to Kulik's reply, I'm pretty sure you can set the NormalTextColours property to white on your layout so you don't have to modify the looknfeel.

Re: problem about format tags

Posted: Tue Dec 27, 2011 04:17
by lixinyiabc123
thank you :lol: