Changeset 5387 for data/media/gui/scripts
- Timestamp:
- Jan 6, 2009, 10:39:28 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/scripts/loadGUI.lua
r5261 r5387 11 11 local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet") 12 12 13 local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton") 14 quit:setText("Quit") 15 quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 16 quit:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.7, 0))) 17 quit:subscribeEvent("Clicked","button_quit_clicked") 13 local leftOffset = 0.11 14 local topOffset = 0.3 15 local distance = 0.076 16 local index = 0 18 17 19 18 local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton") 20 19 standalone:setText("Standalone") 21 20 standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 22 standalone:setPosition(CEGUI.UVector2(CEGUI.UDim( 0.4, 0), CEGUI.UDim(0.3, 0)))21 standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0))) 23 22 standalone:subscribeEvent("Clicked","button_standalone_clicked") 23 index = index + 1 24 24 25 25 local dedicated = winMgr:createWindow("TaharezLook/Button", "orxonox/DedicatedButton") 26 26 dedicated:setText("Dedicated") 27 27 dedicated:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 28 dedicated:setPosition(CEGUI.UVector2(CEGUI.UDim( 0.4, 0), CEGUI.UDim(0.4, 0)))28 dedicated:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0))) 29 29 dedicated:subscribeEvent("Clicked","button_dedicated_clicked") 30 index = index + 1 30 31 31 32 local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton") 32 33 server:setText("Server") 33 34 server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 34 server:setPosition(CEGUI.UVector2(CEGUI.UDim( 0.4, 0), CEGUI.UDim(0.5, 0)))35 server:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0))) 35 36 server:subscribeEvent("Clicked","button_server_clicked") 37 index = index + 1 36 38 37 39 local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton") 38 40 client:setText("Client") 39 41 client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 40 client:setPosition(CEGUI.UVector2(CEGUI.UDim( 0.4, 0), CEGUI.UDim(0.6, 0)))42 client:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0))) 41 43 client:subscribeEvent("Clicked","button_client_clicked") 44 index = index + 1 42 45 43 local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "sample_loading.jpg") 46 local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton") 47 quit:setText("Quit") 48 quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) 49 quit:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0))) 50 quit:subscribeEvent("Clicked","button_quit_clicked") 51 index = index + 1 52 53 local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg") 44 54 local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background") 55 background:setProperty("FrameEnabled", "set: true") 56 background:setProperty("BackgroundEnabled", "set: false") 45 57 background:setProperty("Image", "set: GUI/Background image:full_image") 46 58
Note: See TracChangeset
for help on using the changeset viewer.