Exemple #1
0
        public override void Load()
        {
            _ui = new UIEngine();

            _demos = GetAvailableDemos();
            string[] demoNames = new string[_demos.Length];
            for (int i = 0; i < _demos.Length; i++)
                demoNames[i] = _demos[i].Name;

            // Setup Frame
            var frame = new UIFrame();
            var listBox = new ListBox(Vector2.Zero,
                demoNames,
                (SpriteFont)Utilities.ContentRepository.Repository["BasicFont"],
                Color.Blue);

            listBox.MaximimumElementsDisplayed = 10;
            listBox.SelectionMade += new ListBoxEventHandler(SelectionMade);
            frame.AddControl(listBox);

            frame.KeyUp += new KeyEventHandler(KeyUp);
            _ui.AddAndLoad(frame);
            // End Frame Setup

            Game currentGame = (Game)Utilities.Globals.Data["Game"];
            currentGame.IsMouseVisible = true;
        }
Exemple #2
0
        public override void Load()
        {
            Game currentGame = Globals.Data["Game"];
            SpriteBatch spriteBatch = Globals.Data["SpriteBatch"];
            currentGame.IsMouseVisible = true;

            // Already done by XNAGAme
            //GraphicsUtils.Load(spriteBatch,
            //    ContentRepository.Repository["Pixel"],
            //    ContentRepository.Repository["Ball"]);

            fire = ContentRepository.Repository["fire"];
            smoke = ContentRepository.Repository["smoke"];

            PE = new PhysicsEngine(new Region(0, winSize.Width, 0, winSize.Height), 10);
            PE.AddUniversalForce(DefaultForces.LinearDrag);

            //UI stuff...
            _uiEngine = new UIEngine();
            var frame = new UIFrames.BasicFrame();

            frame.MouseClick += new MouseEventHandler(frame_MouseClick);

            _uiEngine.AddAndLoad(frame);

            Console.WriteLine("CONTROLS:");
            Console.WriteLine("[RCLICK] - detailed 310 particle explosion");
            Console.WriteLine("[LCLICK] - dirty 35 particle explosion");
        }
Exemple #3
0
 public void BindToGUIEngine(UIEngine engine)
 {
     if (UIManager != null)
     {
         throw new Exception("Already bound to a GUIEngine");
     }
     UIManager = engine;
 }
Exemple #4
0
        public override void Load()
        {
            /* initialize game state */
            UIManager = new UIEngine();

            var frame = new UIFrame();
            frame.KeyUp += new KeyEventHandler(frame_KeyUp);
            UIManager.AddAndLoad(frame);
        }
Exemple #5
0
        public override void Load()
        {
            UIManager = new UIEngine();
            var frame = new UIFrames.BasicFrame();
            frame.KeyPressDown += new KeyEventHandler(frame_KeyPressDown);
            UIManager.AddAndLoad(frame);

            Reload();
        }
Exemple #6
0
        public override void Load()
        {
            UIManager = new UIEngine();
            var frame = new UIFrames.BasicFrame();
            frame.MouseClick += new MouseEventHandler(frame_MouseClick);
            frame.KeyPressDown += new KeyEventHandler(frame_KeyPressDown);
            frame.MouseOver += new MouseEventHandler(frame_MouseOver);
            UIManager.AddAndLoad(frame);

            _controller = new KeyboardController(UIManager.ActiveFrame, KeyMappings.PolarMouseMapping);
            _controller.KeyControlEngaged += new KeyControlEventHandler(_controller_KeyControlEngaged);
            _controller.KeyControlDisengaged += new KeyControlEventHandler(_controller_KeyControlDisengaged);

            Reload();
        }
Exemple #7
0
        public override void Load()
        {
            UIManager = new UIEngine();

            var frame = new UIFrame();
            frame.KeyUp += new KeyEventHandler(frame_KeyUp);
            frame.MouseClick += new MouseEventHandler(game_MouseClick);
            UIManager.AddAndLoad(frame);

            var keyController = new KeyboardController(frame, KeyMappings.SimpleMapping);
            keyController.KeyControlEngaged += new KeyControlEventHandler(keyController_KeyControlEngaged);
            keyController.KeyControlDisengaged += new KeyControlEventHandler(keyController_KeyControlDisengaged);
            keyController.KeyControlJustEngaged += new KeyControlEventHandler(keyController_KeyControlJustEngaged);

            frame.MouseOver += new MouseEventHandler(mouseController_MouseOver);

            Reload();
        }
Exemple #8
0
 public override void Load()
 {
     _eng = new UIEngine();
     _eng.AddAndLoad(new UIFrames.BasicFrame());
 }
Exemple #9
0
 public void BindToGUIEngine(UIEngine engine)
 {
     if (UIManager != null)
         throw new Exception("Already bound to a GUIEngine");
     UIManager = engine;
 }