How to let the backgroud of MultiLineEditbox transparency?
Moderators: CEGUI MVP, CEGUI Team
How to let the backgroud of MultiLineEditbox transparency?
I create a MultiLineEditbox window,and set its text (the text is "ABC"),now I want the show of the text is normal,but the backgroud of MultiLineEditbox window is translucency,can you tell me the way?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
You can do it by adding a colour specification in the looknfeel file.
For example in TaharezLook.looknfeel, at around line 3071, you see this:
If you change it to:
It will make the main imagery 50% transparent for the Enabled state.
Alternatively, you could define a property at the top of the WidgetLook, so around line 2935 where you see
add:
Then use this property instead of the specific value shown above, so again at around line 3071, you would have this instead:
You can then write to the property "MainColour" in code or your layouts to change the colour / alpha of the imagery. For example:
Would give you about 25% on the alpha channel.
HTH
CE.
For example in TaharezLook.looknfeel, at around line 3071, you see this:
Code: Select all
<StateImagery name="Enabled">
<Layer>
<Section section="main" />
</Layer>
</StateImagery>
If you change it to:
Code: Select all
<StateImagery name="Enabled">
<Layer>
<Section section="main">
<Colours topLeft="7FFFFFFF" topRight="7FFFFFFF" bottomLeft="7FFFFFFF" bottomRight="7FFFFFFF" />
</Section>
</Layer>
</StateImagery>
It will make the main imagery 50% transparent for the Enabled state.
Alternatively, you could define a property at the top of the WidgetLook, so around line 2935 where you see
Code: Select all
<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
add:
Code: Select all
<PropertyDefinition name="MainColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
Then use this property instead of the specific value shown above, so again at around line 3071, you would have this instead:
Code: Select all
<StateImagery name="Enabled">
<Layer>
<Section section="main">
<ColourProperty name="MainColour" />
</Section>
</Layer>
</StateImagery>
You can then write to the property "MainColour" in code or your layouts to change the colour / alpha of the imagery. For example:
Code: Select all
...
myEditbox->setProperty( "MainColour", "3FFFFFFF" );
...
Would give you about 25% on the alpha channel.
HTH
CE.
Thank CrazyEddie
CrazyEddie,thanks!
Who is online
Users browsing this forum: No registered users and 13 guests