[SOLVED]problem about format tags

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

lixinyiabc123
Just popping in
Just popping in
Posts: 3
Joined: Fri Dec 09, 2011 07:39

[SOLVED]problem about format tags

Postby lixinyiabc123 » Mon Dec 26, 2011 07:10

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
Last edited by lixinyiabc123 on Tue Dec 27, 2011 04:22, edited 1 time in total.

pav
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Thu Dec 01, 2011 14:17

Re: problem about format tags

Postby pav » Mon Dec 26, 2011 12:19

What if you set the buttons' "NormalTextColour" (OgreTray) to FFFFFFFF?

lixinyiabc123
Just popping in
Just popping in
Posts: 3
Joined: Fri Dec 09, 2011 07:39

Re: problem about format tags

Postby lixinyiabc123 » Mon Dec 26, 2011 12:58

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 ? :?:

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: problem about format tags

Postby Kulik » Mon Dec 26, 2011 14:04

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.

pav
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Thu Dec 01, 2011 14:17

Re: problem about format tags

Postby pav » Mon Dec 26, 2011 17:34

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.

lixinyiabc123
Just popping in
Just popping in
Posts: 3
Joined: Fri Dec 09, 2011 07:39

Re: problem about format tags

Postby lixinyiabc123 » Tue Dec 27, 2011 04:17

thank you :lol:


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests