layer problem

haibo19981984

23-06-2010 13:02:28

my layout:

<Widget type="Widget" skin="Default" position="500 350 500 400" layer="Back" name="myDefault1">
<Property key="Widget_Visible" value="true"/>
<Widget type="StaticImage" skin="Game/StaticImage" position_real="0 0 1 1" align="Stretch" layer="Wallpaper" name="myWallPaper">
<Property key="Image_Texture" value="Login.png"/>
</Widget>

<Widget type="Window" skin="Game/WindowCX" position="0 0 208 144" layer="Main" name="window1">
<Property key="Widget_Caption" value="RoleProperty1"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Back" name="window1_1">
<Property key="Widget_Caption" value="Edit1"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Back" name="window1_2">
<Property key="Widget_Caption" value="Button1" />
</Widget>
</Widget>

<Widget type="Window" skin="Game/WindowCX" position="0 150 208 144" layer="Back" name="window2">
<Property key="Widget_Caption" value="RoleProperty2"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Back" name="window2_1">
<Property key="Widget_Caption" value="Edit2"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Back" name="window2_2">
<Property key="Widget_Caption" value="Button2" />
</Widget>
</Widget>
</Widget>

If I remove "<Widget type="Widget" skin="Default" position="500 350 500 400" layer="Back" name="myDefault1">",
there is no problem:window1 is over window2.
But my problem displays just as image "layerError.jpg".
You see the statictext in 2 windows are made to lap over each other.
Whether my script should not write so or not?

Altren

23-06-2010 16:00:35

Use Overlapped layer or any layer that have overlapped property enabled.

haibo19981984

24-06-2010 02:27:39


Use Overlapped layer or any layer that have overlapped property enabled.

Can you show me a example or script?
I'm fail to use script as follows:

<Widget type="Widget" skin="Default" position="500 350 500 400" layer="Overlapped" name="myDefault1">
<Property key="Widget_Visible" value="true"/>
<Widget type="StaticImage" skin="Game/StaticImage" position_real="0 0 1 1" align="Stretch" layer="Wallpaper" name="myWallPaper">
<Property key="Image_Texture" value="Login.png"/>
</Widget>

<Widget type="Window" skin="WindowCSX" position="0 0 208 144" layer="Overlapped" name="window1">
<Property key="Widget_Caption" value="RoleProperty1"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Overlapped" name="window1_1">
<Property key="Widget_Caption" value="Edit1"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Overlapped" name="window1_2">
<Property key="Widget_Caption" value="Button1" />
</Widget>
</Widget>

<Widget type="Window" skin="WindowCSX" position="0 150 208 144" layer="Back" name="window2">
<Property key="Widget_Caption" value="RoleProperty2"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Back" name="window2_1">
<Property key="Widget_Caption" value="Edit2"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Back" name="window2_2">
<Property key="Widget_Caption" value="Button2" />
</Widget>
</Widget>
</Widget>

Moreover,what you want to say may be as follows:

<Widget type="Window" skin="WindowCSX" position="0 0 208 144" layer="Overlapped" name="window1">
<Property key="Widget_Caption" value="RoleProperty1"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Overlapped" name="window1_1">
<Property key="Widget_Caption" value="Edit1"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Overlapped" name="window1_2">
<Property key="Widget_Caption" value="Button1" />
</Widget>
</Widget>

<Widget type="Window" skin="WindowCSX" position="0 150 208 144" layer="Back" name="window2">
<Property key="Widget_Caption" value="RoleProperty2"/>
<Widget type="Edit" skin="Edit" position="28 25 112 32" layer="Back" name="window2_1">
<Property key="Widget_Caption" value="Edit2"/>
</Widget>
<Widget type="Button" skin="Button" position="28 65 88 24" layer="Back" name="window2_2">
<Property key="Widget_Caption" value="Button2" />
</Widget>
</Widget>

This state is that 2 windows are not sub widget of "myDefault1".
After I have a try,maybe when 2 windows are sub widget of "myDefault1",the layer of window is invalid.The display order of sub widget is instead of it.

Altren

24-06-2010 06:00:05

Child widgets don't have layers, so they are not intended to overlap. So you should either make your windows root widgets (without parent), I don't see good reasons for using windows as childs anyway.

Or you can use style="overlapped" for your windows and keep them as child widgets.

haibo19981984

24-06-2010 15:12:02

I had givn up my old idea.
Now I just remove "<Widget type="Widget" skin="Default" position="500 350 500 400" layer="Back" name="myDefault1">",there is no problem.