public void ButtonPressPlay(object sender, EventArgs args)
        {
            // Initialize user interface
            UserInterfaceManager.Initialize();

            // Remove mainmenu and transition
            Transition(UserInterfaceManager.Get <GameWindow>().Console);

            // Instantiate player in the middle of the map
            var spawnPosition = GridManager.Grid.GetCell(a => a.LightProperties.Brightness > 0.3f && a.CellProperties.Walkable);

            Game.Player = EntityManager.Create <Player>(spawnPosition.Position, GridManager.ActiveBlueprint.ObjectId);
            Game.Player.Initialize();

            // Show a tutorial dialog window.
            var dialogWindow = UserInterfaceManager.Get <DialogWindow>();

            dialogWindow.AddDialog("Game introduction", new[]
            {
                "Welcome to Emberpoint.",
                "This is a small introduction to the game.",
                "Press 'Enter' to continue."
            });
            dialogWindow.AddDialog("Flashlight introduction", new[]
            {
                "The flashlight can be used to discover new tiles.",
                "Turn on your flashlight and discover some new tiles.",
                "Press '" + KeybindingsManager.GetKeybinding(Keybindings.Flashlight) + "' to turn on your flashlight.",
                "Press 'Enter' to exit dialog."
            });
            dialogWindow.ShowNext();
        }
        /// <summary>
        /// Load the resources.
        /// </summary>
        /// <remarks>Remember to call the base implementation of this method.</remarks>
        protected override void LoadContent()
        {
            UserInterfaceManager.Initialize();

            //UserInterfaceManager.WindowClosing += Manager_WindowClosing;
            
            InitControls();

            base.LoadContent();
        } // Load
Exemple #3
0
        private static void Init()
        {
            // Initialize user interface
            UserInterfaceManager.Initialize();

            // Keep the dialog window in a global variable so we can check it in the game loop
            DialogWindow = UserInterfaceManager.Get <DialogWindow>();

            // Instantiate player in the middle of the map
            Player = EntityManager.Create <Player>(new Point(Constants.Map.Width / 2, Constants.Map.Height / 2));
            Player.RenderObject(UserInterfaceManager.Get <MapWindow>());

            // Show a tutorial dialog window.
            DialogWindow.ShowDialog("Tutorial", new string[] { "Welcome to Emberpoint.", "Press 'Enter' to continue." });
        }
        public void ButtonPressPlay(object sender, EventArgs args)
        {
            // Initialize user interface
            UserInterfaceManager.Initialize();

            // Remove mainmenu and transition
            Transition(UserInterfaceManager.Get <GameWindow>().Console);

            // Keep the dialog window in a global variable so we can check it in the game loop
            Game.DialogWindow = UserInterfaceManager.Get <DialogWindow>();

            // Instantiate player in the middle of the map
            Game.Player = EntityManager.Create <Player>(GridManager.Grid.GetFirstCell(a => a.LightProperties.Brightness > 0f && a.CellProperties.Walkable).Position);
            Game.Player.Initialize();

            // Show a tutorial dialog window.
            Game.DialogWindow.ShowDialog("Tutorial", new string[] { "Welcome to Emberpoint.", "To turn on your flashlight, press 'F'.", "Press 'Enter' to continue." });
        }
        public MiniUIApplication()
        {
            var services = new ServiceRegistry();
            // Needs to be declared before the D3D device manager as it hooks to
            // the D3D device creation event
            var d2dDeviceManager = new Direct2DDeviceManager(services);

            d3dDeviceManager = ToDispose(new SimpleDeviceManager(services)
            {
                HorizontalDpi             = 96.0f,
                VerticalDpi               = 96.0f,
                PreferredBackBufferWidth  = 1280,
                PreferredBackBufferHeight = 720,
                PreferredBackBufferFormat = Format.R8G8B8A8_UNorm,
                IsFullScreen              = false,
                IsStereo = false,
                PreferredGraphicsProfile  = new[] { FeatureLevel.Level_11_0, },
                PreferredMultiSampleCount = 1
            });
            form = new RenderForm("OdysseyUI Test")
            {
                ClientSize = new Size(d3dDeviceManager.PreferredBackBufferWidth, d3dDeviceManager.PreferredBackBufferHeight),
            };

            d3dDeviceManager.CreateDevice(form.Handle, DeviceCreationFlags.Debug | DeviceCreationFlags.BgraSupport);

            var content      = new ContentManager(services);
            var styleManager = new StyleManager(services);

            uiManager       = new DesktopUserInterfaceManager(services);
            applicationTime = new ApplicationTime();
            timerTick       = new TimerTick();

            services.AddService(typeof(IStyleService), styleManager);
            services.AddService(typeof(IUserInterfaceState), uiManager);
            services.AddService(typeof(IWindowService), this);
            services.AddService(typeof(IDirect2DService), d2dDeviceManager);

            content.LoadAssetList("Assets/Assets.yaml");

            overlay = ToDispose(SampleOverlay.New(services));
            uiManager.Initialize();
            uiManager.CurrentOverlay = overlay;
        }
Exemple #6
0
        private void Start()
        {
            UserInterfaceManager.Initialize();

            this.FullTransition(UserInterfaceManager.Get <GameWindow>());
        }