Beispiel #1
0
        public void Begin()
        {
            guiModule = new GuiModule(Main.GraphicsDevice, Main.Input);
            inputModule = new InputModule(Main.Input);

            simulation = new Simulation(Main.Content, new MISP.GenericScriptObject(
                "episode-name", "main-menu", "server", null));
            simulation.debugOutput += (s) => { Main.Write(s); };
            simulation.Content.FrontLoadTextures();
            Main.Write("Started menu simulation\n");
            Main.ScriptEngine.PrepareEnvironment(simulation.scriptEngine);
            Main.ScriptEngine.AddEnvironment("menu", simulation.scriptEngine, simulation.scriptContext);

            renderModule = new RenderModule(Main.GraphicsDevice, simulation.Content);
            simulation.modules.Add(renderModule);
            octTreeModule = new OctTreeModule(new BoundingBox(new Vector3(-100, -100, -100), new Vector3(100, 100, 100)), 5.0f);
            simulation.modules.Add(octTreeModule);
            simulation.modules.Add(inputModule);
            simulation.modules.Add(guiModule);

            simulation.beginSimulation();

            //var labelString = "Jemgine";

            //var label = new UIItem(Layout.CenterItem(new Rectangle(0, 0, 10 * labelString.Length, 16),
            //    Main.GraphicsDevice.Viewport.Bounds));
            //label.settings = new MISP.GenericScriptObject(
            //    "bg-color", new Vector3(0, 0, 0),
            //    "text-color", new Vector3(1,1,1),
            //    "label", labelString);
            //guiModule.uiRoot.AddChild(label);
        }
Beispiel #2
0
        public GuiSceneNode(int width, int height, GuiModule module)
        {
            this.module = module;

            uiCamera = new OrthographicCamera(new Viewport(0,0, width, height));
            uiRoot = new UIItem(new Rectangle(0,0,width,height));
            uiRoot.defaults = module.defaultSettings;
            uiRoot.settings = new MISP.GenericScriptObject();

            uiCamera.focus = new Vector2(width / 2, height / 2);
        }
Beispiel #3
0
 public void Begin()
 {
     clientModule = new Network.ClientModule(host, port, this);
     guiModule = new GuiModule(Main.GraphicsDevice, Main.Input);
     inputModule = new InputModule(Main.Input);
 }