My code is like:
Code: Select all
oRootWindow = winMgr:loadWindowLayout("TestPosWindow.layout")
oSlotWindow = winMgr:createWindow("TaharezLook/StaticImage", "TestSlotWindow")
oSlotWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 5), CEGUI.UDim(0, 15)))
oSlotWindow:setWidth(CEGUI.UDim(0,32))
oSlotWindow:setHeight(CEGUI.UDim(0,32))
oContainerWindow = winMgr:createWindow("TaharezLook/StaticImage", "TestContainerWindow")
oContainerWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 10), CEGUI.UDim(0, 10)))
oContainerWindow:setWidth(CEGUI.UDim(0,32))
oContainerWindow:setHeight(CEGUI.UDim(0,32))
Init these windows first and then set their relation in different orders:
code that get right position
Code: Select all
oRootWindow:addChildWindow(oSlotWindow)
oSlotWindow:addChildWindow(oContainerWindow)
result
and code error occurs
Code: Select all
oSlotWindow:addChildWindow(oContainerWindow)
oRootWindow:addChildWindow(oSlotWindow)
result
Is CEGUI windows position must be initialised in the right order or this problem can be solved?
Thanks~