Ejemplo n.º 1
0
        protected override void Start()
        {
            base.Start();
            Console.SubscribeToConsoleCommand(HandleConsoleCommand);
            Input.SubscribeToKeyDown(HandleEscKeyDown);
            IsLogoVisible = false;

            // Show the console by default, make it large. Console will show the text edit field when there is at least one
            // subscriber for the console command event
            var console = Console;

            console.NumRows             = (uint)(Graphics.Height / 16);
            console.NumBufferedRows     = 2 * console.NumRows;
            console.CommandInterpreter  = GetType().Name;
            console.Visible             = true;
            console.CloseButton.Visible = false;

            // Show OS mouse cursor
            Input.SetMouseVisible(true, false);

            // Open the operating system console window (for stdin / stdout) if not open yet
            UrhoConsole.OpenConsoleWindow();

            // Initialize game and print the welcome message
            StartGame();
        }
Ejemplo n.º 2
0
        protected override void Start()
        {
            Log.LogLevel = LogLevel.Debug;
            ResourceCache.AutoReloadResources = true;

            var xml = ResourceCache.GetXmlFile("UI/DefaultStyle.xml");

            console = Engine.CreateConsole();
            console.DefaultStyle       = xml;
            console.Background.Opacity = 0.8f;
            debugHud = Engine.CreateDebugHud();
            debugHud.DefaultStyle = xml;

            var hud = new MonoDebugHud(this);

            CreateScene(null);

            Input.KeyDown           += OnKeyDown;
            Input.MouseWheel        += OnMouseWheel;
            Input.MouseMoved        += OnMouseMoved;
            Engine.PostRenderUpdate += args => { if (DrawDebugFrame)
                                                 {
                                                     Renderer.DrawDebugGeometry(false);
                                                 }
            };
        }
Ejemplo n.º 3
0
        protected override void OnUpdate(float timeStep)
        {
            // Check if there is input from stdin
            string input = UrhoConsole.GetConsoleInput();

            if (!string.IsNullOrEmpty(input))
            {
                HandleInput(input);
            }
        }
Ejemplo n.º 4
0
        void CreateConsoleAndDebugHud()
        {
            var xml = cache.GetXmlFile("UI/DefaultStyle.xml");

            console = Engine.CreateConsole();
            console.DefaultStyle       = xml;
            console.Background.Opacity = 0.8f;

            debugHud = Engine.CreateDebugHud();
            debugHud.DefaultStyle = xml;
        }
Ejemplo n.º 5
0
		void CreateConsoleAndDebugHud()
		{
			var xml = cache.GetXmlFile("UI/DefaultStyle.xml");
			console = Engine.CreateConsole();
			console.DefaultStyle = xml;
			console.Background.Opacity = 0.8f;

			debugHud = Engine.CreateDebugHud();
			debugHud.DefaultStyle = xml;
		}