Trouble with layers (I think!)

AshMcConnell

16-07-2010 08:49:05

Hi Folks,

Here is a video of my problem : http://www.twitvid.com/SCRPR

The problem is that when the top menu is moved to the right the text appears in front of the ORC logo, but the background appears behind.

The background is on the "Back" layer, the logo is on the "Tooltip" layer

Is there any way to force the text to go behind?

Thanks for your help
All the best,
Ash

my.name

16-07-2010 09:34:45

show me layouts.

AshMcConnell

16-07-2010 10:01:27

Here it is, thanks for having a look!

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Widget" skin="GradientBottom" position="0 610 742 102" align="HStretch Bottom" layer="Main" name="otherButtons">
<Widget type="Widget" skin="PanelEmpty" position="24 1 694 100" align="Center" layer="Main" name="otherButtonsInner">
<Widget type="Button" skin="ButtonStats" position="10 8 93 92" name="stats"/>
<Widget type="Button" skin="ButtonTopup" position="610 8 93 92" name="topUp"/>
<Widget type="Button" skin="ButtonWWW" position="490 8 93 92" name="www"/>
<Widget type="Button" skin="PlayerAdmin" position="730 8 93 92" name="playerAdmin">
<Property key="Widget_Visible" value="false"/>
</Widget>
<Widget type="Button" skin="PlayerAdmin" position="850 8 93 92" name="serverAdmin">
<Property key="Widget_Visible" value="false"/>
</Widget>
<Widget type="Button" skin="VoteButton" position="370 8 93 92" name="voteRestart"/>
<Widget type="Button" skin="DriverListButton" position="250 8 93 92" name="driverList"/>
<Widget type="Button" skin="ChatButton" position="130 8 93 92"/>
</Widget>
</Widget>
<Widget type="Widget" skin="GradientTop" position="0 24 1394 110" align="Left Top" layer="Back" name="topBackground">
<Widget type="StaticText" skin="StaticText" position="0 32 160 48" name="startRace">
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Widget_Caption" value="Race"/>
<Property key="Text_TextAlign" value="Center"/>
<UserString key="tooltip" value="Join the track and start racing"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="160 32 160 48" name="resume">
<Property key="Widget_Caption" value="Resume"/>
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Text_TextAlign" value="Center"/>
<UserString key="tooltip" value="Resume racing or spectating"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="320 32 160 48" name="carSetup">
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Widget_Caption" value="Setup"/>
<Property key="Text_TextAlign" value="Center"/>
<UserString key="tooltip" value="Tweak your car setup to gain that extra tenth"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="480 32 160 48" name="options">
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Widget_Caption" value="Options"/>
<Property key="Text_TextAlign" value="Center"/>
<Property key="Text_TextColour" value="#EEEEEE"/>
<UserString key="tooltip" value="Set up your controls / graphics / sound / etc."/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="640 32 128 48" name="back">
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Widget_Caption" value="Quit"/>
<Property key="Text_TextAlign" value="Center"/>
<UserString key="tooltip" value="Leave this race and go back to the main menu"/>
</Widget>
<Widget type="Widget" skin="MarkerWhite" position="160 36 2 40"/>
<Widget type="Widget" skin="MarkerWhite" position="320 36 2 40"/>
<Widget type="Widget" skin="MarkerWhite" position="480 36 2 40"/>
<Widget type="Widget" skin="MarkerWhite" position="640 36 2 40"/>
<Widget type="StaticText" skin="StaticText" position="0 32 160 48" name="pits">
<Property key="Text_FontName" value="font_Eurostib.50"/>
<Property key="Widget_Caption" value="Pit"/>
<Property key="Text_TextAlign" value="Center"/>
<Property key="Widget_Visible" value="false"/>
</Widget>
</Widget>
<Widget type="Widget" skin="OrcLogoTopRight" position="1098 29 224 205" align="Right Top" layer="Tooltip"/>
</MyGUI>

AshMcConnell

17-07-2010 16:10:54

Any ideas what I could do to fix the problem?

Could you give me a bit of information on how child widgets assigned to layers?

Thanks for your help!
Ash

AshMcConnell

21-07-2010 08:26:26

Any tips would be appreciated?

Thanks!
Ash

my.name

21-07-2010 09:21:38

Show me layer xml

my.name

21-07-2010 09:26:57

<Widget type="Widget" skin="OrcLogoTopRight" position="1098 29 224 205" align="Right Top" layer="ToolTip"/>

AshMcConnell

21-07-2010 09:40:40

Yep, i've tried it on the "Main" layer too and it doesn't make a difference.

The "topBackground" widget flows behind the "OrcLogoTopRight", but all the static text widgets (which are children of the topBackground widget) flow in front of the "OrcLogoTopRight" widget, I don't think this is expected behaviour?

Is there anything that can be done to get the StaticText widgets ( startRace / resume / carSetup / options and back) to appear behind the OrcLogoTopRight widget?

All the best,
Ash

AshMcConnell

28-07-2010 17:58:55

Hi Guys,

Is there any possible fix or workaround for this problem?

All the best,
Ash

my.name

29-07-2010 09:41:20

change layer style to 'Overlapped'
show me core_layer.xml

AshMcConnell

29-07-2010 09:48:02

Hi my.name,

Which one should be "Overlapped"? topBackground or OrcLogoTopRight or both?

*edit* I tried all combinations, but the text is still in front of the logo and the background is behind the logo

Here is my core_layer.xml
<?xml version="1.0" encoding="UTF-8"?>

<MyGUI type="Layer" version="1.2">

<Layer type="SharedLayer" name="Wallpaper">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="Back">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="OverlappedLayer" name="Overlapped">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="SharedLayer" name="Middle">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="OverlappedLayer" name="Modal">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="SharedLayer" name="Main">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="OverlappedLayer" name="Popup">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="SharedLayer" name="FadeMiddle">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="OverlappedLayer" name="Info">
<Property key="Pick" value="true"/>
</Layer>
<Layer type="SharedLayer" name="ToolTip">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="DragAndDrop">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="FadeBusy">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="Pointer">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="Fade">
<Property key="Pick" value="false"/>
</Layer>
<Layer type="SharedLayer" name="Statistic">
<Property key="Pick" value="false"/>
</Layer>

</MyGUI>


Thanks!
Ash

Altren

29-07-2010 18:52:17

I tried your layout and it works fine after I changed Tooltip layer to ToolTip. I'm surprised how you was able to see that logo at all.
Also try to use default font for text and see if it is still above Logo.

AshMcConnell

29-07-2010 19:10:05

I tried your layout and it works fine after I changed Tooltip layer to ToolTip. I'm surprised how you was able to see that logo at all.
Also try to use default font for text and see if it is still above Logo.


Ah, I didn't notice the capital T in ToolTip. Unfortunately it didn't make any difference for me:

[attachment=0]Orc 2010-07-29 19-02-24-97.jpg[/attachment]

I tried removing the specified font (to let it choose the default) and it was the same

I'm not sure what could be going wrong, perhaps I should try the version in SVN?

Thanks for trying to help!
All the best,
Ash

Altren

30-07-2010 00:49:50

Yes, try SVN version if it is possible.

Also this is really weird that it works with Tooltip layer without capital T. Normal behaviour is that widget is not visible at all. May be you attaching widget to "Back" layer so it is visible and gives you wrong behaviour. To test that change Back layer in core_layer.xml: replace
<Layer type="SharedLayer" name="Back">
<Property key="Pick" value="true"/>
</Layer>
with <Layer type="OverlappedLayer" name="Back">
<Property key="Pick" value="true"/>
</Layer>

AshMcConnell

02-08-2010 19:39:35

Aha, I've just realised that I've supplied a parent widget when creating each menu layout (I treat each menu like a menu "page"). It's good to have a single parent to show / hide all the children, I'll have to think about doing it another way

I do think that having a parent should perhaps just increase the layer number that all the children are on rather than inheriting the layer number would be a more natural way of doing things, it does seem to trip up quite a few people.

Sorry that I didn't spot the problem earlier, I had a layer of abstraction in the way.

All the best,
Ash