Code: Select all
function loadUI()
--set up some general CEGUI variables
local winMgr = CEGUI.WindowManager:getSingleton()
local logger = CEGUI.Logger:getSingleton()
local system = CEGUI.System:getSingleton()
--variables for my gui
local layout = winMgr:loadWindowLayout("Screen.xml")
local GWin = winMgr:getWindow("GameWindow")
local area = winMgr:getWindow("Area")
--set GUI sheet, and make GameWindow invisible (it will be shown later)
layout:setVisible(true)
system:setGUISheet(layout)
GWin:setVisible(false)
--Create button and set it's properties.
local tempbox = winMgr:createWindow("TaharezLook/Button", "myButton")
area:addChildWindow(tempbox)
tempbox:setPosition(CEGUI.Size(0.5,0.5))
tempbox:setSize(CEGUI.Size(0.2, 0.2))
tempbox:setVisible(true)
tempbox:setText("myButton")
tempbox:setClippedByParent(false)
tempbox:isAlwaysOnTop(true)
return 0
end
Any ideas why I can see the GameWindow and Area just fine, but what I can't see is the button I've created.