Ejemplo n.º 1
0
        /// <summary>
        /// Initializes io2GameLib
        /// </summary>
        public Io2GameLibGame()
        {
            // Regular initialization stuff
            Content.RootDirectory = "Content";
            Graphics = new GraphicsDeviceManager(this);
            Graphics.IsFullScreen = true;

            // Extend battery life under lock.
            // InactiveSleepTime = TimeSpan.FromSeconds(1); // CRASH on WIN8

            // Create the settings object
            Settings = new GameLibSettings();

            // Create the screenmanager
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            // Add the default background screen
            ScreenManager.AddScreen(new BackgroundScreen());

            // Let the user get a change to initialize there own services
            InitializeServices();

            // Register the default services
            RegisterDefaultServices();

            // An old construct still alive
            Io2GameLibGame.instance = this;
        }
Ejemplo n.º 2
0
 static void LoadScreen(ScreenManager manager)
 {            
     ///add the first screen here
     ///WE ARE ADDING THE DEFERRED SCREEN, you can add wherever you want
     manager.AddScreen(new TemplateDeferredScreen());
     
 }
Ejemplo n.º 3
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 public static void Main()
 {
     using (ScreenManager scrManager = new ScreenManager())
     {
         scrManager.Run();
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// The main game constructor.
        /// </summary>
        public Game()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = SettingsManager.GAME_WIDTH;
            graphics.PreferredBackBufferHeight = SettingsManager.GAME_HEIGHT;
            SettingsManager.GraphicsDevice = graphics;

            // create our screen manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            // frame rate counter for testing
            //Components.Add(new FrameRateCounter(this));

            // initialize resource manager
            ResourceManager.Instance.InitializeContent(this);

            // active the first screens
            // THESE LINES SHOULD BE COMMENTED AND LAST LINE UNCOMMENTED TO INCLUDE INTRO SCREEN AND MENU
            //screenManager.AddScreen(new IntroScreen());
            screenManager.AddScreen(new BackgroundScreen());
            //screenManager.AddScreen(new MainMenuScreen());
            screenManager.AddScreen(new LogoScreen());
            //screenManager.AddScreen(new TextOnBlackScreen("AVANTgarde",  new GameScreen[] { new BackgroundScreen(), new LogoScreen() }));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///   Constructs a new input state.
        /// </summary>
        public InputHelper(ScreenManager manager)
        {
            _currentKeyboardState = new KeyboardState();
            _currentGamePadState = new GamePadState();
            _currentMouseState = new MouseState();
            _currentVirtualState = new GamePadState();

            _lastKeyboardState = new KeyboardState();
            _lastGamePadState = new GamePadState();
            _lastMouseState = new MouseState();
            _lastVirtualState = new GamePadState();

            _manager = manager;

            _cursorIsVisible = false;
            _cursorMoved = false;
            #if WINDOWS_PHONE
            _cursorIsValid = false;
            #else
            _cursorIsValid = true;
            #endif
            _cursor = Vector2.Zero;

            _handleVirtualStick = false;
        }
Ejemplo n.º 6
0
        public CircularGame()
        {
            Window.Title = "Circular";
            _graphics = new GraphicsDeviceManager ( this ) {
                                                               PreferMultiSampling = true,
                                                               PreferredBackBufferWidth = 1280,
                                                               PreferredBackBufferHeight = 720
                                                           };

            #if WINDOWS || XBOX
            ConvertUnits.SetDisplayUnitToSimUnitRatio ( 24f );
            IsFixedTimeStep = true;
            #elif WINDOWS_PHONE
            _graphics.PreferredBackBufferWidth = 800;
            _graphics.PreferredBackBufferHeight = 480;
            ConvertUnits.SetDisplayUnitToSimUnitRatio(16f);
            IsFixedTimeStep = false;
            #endif

            #if WINDOWS
            _graphics.IsFullScreen = false;
            #elif XBOX || WINDOWS_PHONE
            _graphics.IsFullScreen = true;
            #endif

            Content.RootDirectory = "Content";

            //new-up components and add to Game.Components
            ScreenManager = new ScreenManager ( this );
            Components.Add ( ScreenManager );

            var frameRateCounter = new FPSComponent ( ScreenManager ) { DrawOrder = 101 };
            Components.Add ( frameRateCounter );
        }
Ejemplo n.º 7
0
 private LoadingScreen(ScreenManager screenManager, NetworkManager nManager, GameScreen[] screens)
 {
     isNetworkGame = true;
     netManager = nManager;
     screensToLoad = screens;
     TransitionOnTime = TimeSpan.FromSeconds(1.0);
 }
Ejemplo n.º 8
0
        public Graphics()
        {
            this.graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = Convert.ToInt32(ProgramSettings.ResolutionWidth);
            this.graphics.PreferredBackBufferHeight = Convert.ToInt32(ProgramSettings.ResolutionHeight);
            this.graphics.IsFullScreen = ProgramSettings.FullscreenMode;
            Content.RootDirectory = "Content";

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            screenManager.GraphicsDeviceManager = this.graphics;

            MultiInputManager manager = new MultiInputManager();
            if (ProgramSettings.KinectEnabled && KinectHelper.Instance().isRunning())
                manager.AddInputDevice(new GestureEventManager());

            screenManager.OtherInput = manager;
            Components.Add(screenManager);

            // Create the first screen
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
Ejemplo n.º 9
0
        public static void Load(ScreenManager screenManager, bool loadingIsSlow, string message, params GameScreen[] screensToLoad)
        {
            bool screensHaveTransition = false;
            foreach (GameScreen screen in screenManager.Screens)
            {
                _temporaryScreenList.Add(screen);
            }

            // Tell all the current screens to transition off.
            foreach (GameScreen screen in _temporaryScreenList)
            {
                if (screen.TransitionOffTime != TimeSpan.Zero)
                {
                    screensHaveTransition = true;
                }

                screen.ExitScreen();
            }
            _temporaryScreenList.Clear();

            if (screensHaveTransition)
            {
                screenManager.AddScreen(new LoadingScreen(screenManager, loadingIsSlow, message, screensToLoad));
            }
            else
            {
                foreach (GameScreen screen in screensToLoad)
                {
                    screenManager.AddScreen(screen);
                }
            }
        }
Ejemplo n.º 10
0
        public FarseerPhysicsGame(UserControl userControl, Canvas drawingCanvas, Canvas debugCanvas, TextBlock txtFPS, TextBlock txtDebug)
            : base(userControl, drawingCanvas, debugCanvas, txtDebug)
        {
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 16);
            IsFixedTimeStep = true;

            //new-up components and add to Game.Components
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            if (txtFPS != null)
            {
                FrameRateCounter frameRateCounter = new FrameRateCounter(ScreenManager, txtFPS);
                Components.Add(frameRateCounter);
            }

            Demo1Screen demo1 = new Demo1Screen();
            Demo2Screen demo2 = new Demo2Screen();
            Demo3Screen demo3 = new Demo3Screen();
            Demo4Screen demo4 = new Demo4Screen();
            Demo5Screen demo5 = new Demo5Screen();
            Demo6Screen demo6 = new Demo6Screen();
            Demo7Screen demo7 = new Demo7Screen();
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo1.GetTitle(), demo1);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo2.GetTitle(), demo2);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo3.GetTitle(), demo3);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo4.GetTitle(), demo4);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo5.GetTitle(), demo5);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo6.GetTitle(), demo6);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo7.GetTitle(), demo7);

            ScreenManager.GoToMainMenu();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Closing doors transition
        /// </summary>
        /// <param name="sceneManager">The SceneManager</param>
        /// <paramparam name="direction">The Direction to slide the doors. Use the Direction enumeration</paramparam>
        public Doors(ScreenManager sceneManager, Direction direction)
            : base(sceneManager)
        {
            this.speed = 2f;
            this.direction = direction;
            this.waitTime = 300;

            this.positionDoorOne = Vector2.Zero;
            this.positionDoorTwo = Vector2.Zero;

            switch (direction)
            {
                case Direction.Horizontal:
                    width = viewport.Width >> 1;
                    height = viewport.Height;
                    moveDoorOne = startPositions.X = -width;
                    moveDoorTwo = startPositions.Y = viewport.Width;
                    middle = width;
                    break;
                case Direction.Vertical:
                    width = viewport.Width;
                    height = viewport.Height >> 1;
                    moveDoorOne = startPositions.X = -height;
                    moveDoorTwo = startPositions.Y = viewport.Height;
                    middle = height;
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 12
0
        public Platformer()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenManager = new ScreenManager(this);
        }
Ejemplo n.º 13
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            graphics.PreferredBackBufferHeight = 1050;
            graphics.PreferredBackBufferWidth = 1680;
            Window.IsBorderless = true;

            Content.RootDirectory = "Content";
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            AddInitialScreens();

            //IntPtr hWnd = this.Window.Handle;
            //var control = System.Windows.Forms.Control.FromHandle(hWnd);
            //var form = control.FindForm();
            //form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            //form.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            //var screen = Screen.AllScreens.First(e => e.Primary);
            //Window.IsBorderless = true;
            //Window.Position = new Point(screen.Bounds.X, screen.Bounds.Y);
            //graphics.PreferredBackBufferWidth = screen.Bounds.Width;
            //graphics.PreferredBackBufferHeight = screen.Bounds.Height;
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            _screens = new ScreenManager(this);
            Components.Add(_screens);

            base.Initialize();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            screenManager = new ScreenManager(this);
            screenManager.Push(new MainMenu(screenManager));

            base.Initialize();
        }
Ejemplo n.º 16
0
        public SpeedTrainerHud(ScreenManager screenManager, Metronome metronome, Rectangle rect)
            : base(screenManager, metronome, rect)
        {
            // Initialize Texts
            mTexts = new [,]{{"Increase By", "BMP"},{"Increase After", "Bars"},{ "Increase Up To", "BMP"}};
            mTextPositions = new Vector2[mTexts.GetLength(0)];
            for (var i = 0; i < mTexts.GetLength(0); i++)
            {
                var xpos = mRectangle.X + 10;
                var ypos = mRectangle.Y + 70 + i * 40;
                mTextPositions[i] = new Vector2(xpos, ypos);
            }

            // Initialize TextBoxes
            mTextBoxes = new TextBox[mTexts.GetLength(0)];
            for (var i = 0; i < mTextBoxes.Length; i++)
            {
                mTextBoxes[i] = new TextBox(new Rectangle(mRectangle.X + mRectangle.Width - 120, (int) mTextPositions[i].Y, 60, 25), true);
            }

            mTextBoxes[0].SetDefaultText("10");
            mTextBoxes[1].SetDefaultText("8");
            mTextBoxes[2].SetDefaultText("200");

            // Initialize values from Metronome
            mTextBoxes[0].SetText(mMetronome.mIncreaseBy.ToString());
            mTextBoxes[1].SetText(mMetronome.mIncreaseAfter.ToString());
            mTextBoxes[2].SetText(mMetronome.mIncreaseUpTo.ToString());
        }
Ejemplo n.º 17
0
        public MetronomeScreen(ScreenManager screenManager, ContentManager content)
        {
            mContent = content;
            mMetronome = File.Exists("savedata.txt") ? SaveData.GetInstance().Load("savedata.txt") : new Metronome();
            mScreenManager = screenManager;
            mRectangle = new Rectangle(0, 0, Game.mScreenWidth, Game.mScreenHeight);

            // Initialize other screens
            const int width = 300;
            const int height = 200;
            var rect = new Rectangle(Game.mScreenWidth / 2 - width / 2, Game.mScreenHeight / 2 - height / 2, width, height);
            mSpeedTrainerHud = new SpeedTrainerHud(mScreenManager, mMetronome, rect);
            mStopHud = new StopHud(mScreenManager, mMetronome, rect);
            mSideBar = new SideBar(mScreenManager, mContent, mMetronome, new Rectangle(0, 0, Game.mScreenWidth / 5, Game.mScreenHeight));

            // Initialize buttons
            RunAction[] actions =
            {
                mMetronome.Resume, mMetronome.Pause, mMetronome.Stop, null, null, null, null, mMetronome.ToggleAutoStop, mMetronome.ToggleAutoIncrease
            };
            RunAction[] rightActions = {ShowStopHud, ShowSpeedTrainerHud};
            string[] names = {"Play", "Pause", "Stop", "Increase", "Decrease", "Increase10", "Decrease10", "StopMode", "SpeedMode"};
            int[] parameters = {1, -1, 10, -10};

            mButtons = new Button[actions.Length];
            for (var i = 0; i < mButtons.Length; i++)
            {
                mButtons[i].mTexName = names[i];
                mButtons[i].mState = OwnButtonState.Normal;
                mButtons[i].mAction = actions[i];
                mButtons[i].mTextures = new Texture2D[3];
                if (i > 2 && i < 7)
                {
                    mButtons[i].mParameterAction = mMetronome.ChangeTempoBy;
                    mButtons[i].mParameter = parameters[i - 3];
                }
                else if (i >= 7)
                {
                    mButtons[i].mActionRight = rightActions[i-7];
                }
            }

            var size = 64;
            mButtons[0].mRectangle = new Rectangle((int)(mRectangle.Width / 2f - (size + 10)), 20, size, size);
            mButtons[1].mRectangle = mButtons[0].mRectangle;
            mButtons[2].mRectangle = new Rectangle((int) (mRectangle.Width / 2f + 10), 20, size, size);
            size = 32;
            mButtons[3].mRectangle = new Rectangle((int)(mRectangle.Width / 2f - (size + 50)), 470, size, size);
            mButtons[4].mRectangle = new Rectangle((int)(mRectangle.Width / 2f + 50), 470, size, size);
            mButtons[5].mRectangle = new Rectangle((int)(mRectangle.Width / 2f - (size + 50)), 520, size, size);
            mButtons[6].mRectangle = new Rectangle((int)(mRectangle.Width / 2f + 50), 520, size, size);
            size = 50;
            mButtons[7].mRectangle = new Rectangle((int)(mRectangle.Width / 2f - (size + 130)), 490, size, size);
            mButtons[8].mRectangle = new Rectangle((int)(mRectangle.Width / 2f + 130), 490, size, size);

            mButtons[0].mInvisible = mMetronome.mPlayState == Metronome.PlayState.Playing;
            mButtons[1].mInvisible = mMetronome.mPlayState != Metronome.PlayState.Playing;

            mIsPointerLeft = true;
        }
Ejemplo n.º 18
0
Archivo: Game.cs Proyecto: zidsal/Blob
        protected override void Initialize()
        {
            CreateGameSettings();
            _screenmanager = ScreenManager.Instance(this);

            base.Initialize();
        }
Ejemplo n.º 19
0
    public void Fill(ScreenManager.State state, Dictionary<string, string> info, Dictionary<BackEnd.Tuple<string, string>, BackEnd.Tuple<int, int>> patients)
    {
        switch(state)
        {
            case ScreenManager.State.TherapistProfile:

                TherapistLeftColumn.text = "Name:\n" + info["first_name"] + " " + info["last_name"]
                                        + "\n\nUsername:\n" + info["username"] + "\n\nEmail:\n" + info["email"];
                TherapistrightColumn.text = "Practice Setting:\n" + info["practice_setting"]  + "\n\nFacility Name:\n" + info["name"] + "\n\nLocation:\n" + info["city"]
                    +", " + info["state"];

                dropdown.ClearOptions();

                dropdown.options.Add(new Dropdown.OptionData(""));

                foreach (KeyValuePair<BackEnd.Tuple<string, string>, BackEnd.Tuple<int, int>> tuples in patients)
                {

                    dropdown.options.Add(new Dropdown.OptionData(tuples.Key.First+", "+ tuples.Key.Second));
                }
                break;

            case ScreenManager.State.PatientProfile:

                info["visual_mod"] = Interpret(info["visual_mod"]);
                info["auditory_mod"] = Interpret(info["auditory_mod"]);

                PatientLeftColumn.text = "Name:\n" + info["first_name"] + " " + info["last_name"]
                                       + "\n\nUsername:\n" + info["username"] + "\n\nEmail:\n" + info["email"];
                PatientMiddleColumn.text = "Sex:\n" + info["sex"] + "\n\nDate of Birth\n" + info["date_of_birth"] + "\n\nDate of Admission:\n" + info["date_of_admission"];
                PatientRightColumn.text = "Treatment Setting:\n" + info["treatment_setting"] + "\n\nAuditory Modifications:\n" + info["auditory_mod"] + "\n\nVisual Modification:\n" + info["visual_mod"];

                break;
        }
    }
Ejemplo n.º 20
0
        public static void Init(ScreenManager nScreenManager)
        {
            mScreenManager = nScreenManager;

            string[] pieces;
            string relpath;
            bool inSounds;
            foreach (string filepath in Directory.GetFiles(Directory.GetCurrentDirectory() + "\\" + mScreenManager.Content.RootDirectory + "\\Sounds", "*.wav", SearchOption.AllDirectories))
            {
                pieces = filepath.Split('\\');
                relpath = "";
                inSounds = false;
                foreach (string piece in pieces)
                {
                    if (piece == "Content")
                    {
                        inSounds = true;
                    }
                    else if (inSounds)
                    {
                        if (!piece.Contains('.'))
                        {
                            relpath += piece + "\\";
                        }
                        else
                        {
                            relpath += piece.Substring(0, piece.Length - (piece.Length - piece.LastIndexOf('.')));
                        }
                    }
                }
                relpath = relpath.Replace('\\', '/');
                mSounds.Add(relpath.Substring(relpath.LastIndexOf('/') + 1), mScreenManager.Content.Load<SoundEffect>(relpath));
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ScreenManager screenMgr = new ScreenManager())
     {
         screenMgr.Run();
     }
 }
Ejemplo n.º 22
0
 private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow,
                       GameScreen[] screensToLoad)
 {
     this.loadingIsSlow = loadingIsSlow;
     this.screensToLoad = screensToLoad;
     TransitionOnTime = TimeSpan.FromSeconds(0.5);
 }
Ejemplo n.º 23
0
        public Graphics(Game game, SpriteBatch spriteBatch, ContentManager contentManager, GraphicsDeviceManager graphicsDeviceManager)
        {
            this.spriteBatch = spriteBatch;
            this.contentManager = contentManager;
            this.graphicsDeviceManager = graphicsDeviceManager;

            screenManager = new ScreenManager();
            overlayManager = new OverlayManager();

            textures = new Dictionary<string, Texture2D>();
            spriteFonts = new Dictionary<string, SpriteFont>();

            //Hooking up initial event so we can notify and shit.
            game.Window.ClientSizeChanged += (sender, e) =>
            {
                if(ResolutionChanged != null)
                {
                    Rectangle newSize = new Rectangle(0, 0,
                        graphicsDeviceManager.GraphicsDevice.Viewport.Width,
                        graphicsDeviceManager.GraphicsDevice.Viewport.Height
                    );
                    ResolutionChanged(this, newSize);
                }
            };

            _Rectangle = new Texture2D(graphicsDeviceManager.GraphicsDevice, 1, 1);
            _Rectangle.SetData(new Color[] { Color.White });
        }
		public FrameRateCounter(ScreenManager screenManager)
            : base(screenManager.Game)
        {
            _screenManager = screenManager;
            _format = new NumberFormatInfo();
            _format.NumberDecimalSeparator = ".";
        }
Ejemplo n.º 25
0
        public SpriteManager(ContentManager c, ScreenManager s)
        {
            isNetworkGame = false;
            screenManager = s;
            content = c;
            screenWidth = screenManager.GraphicsDevice.Viewport.Width;
            screenHeight = screenManager.GraphicsDevice.Viewport.Height;
            titleSafeLeft = screenManager.GraphicsDevice.Viewport.TitleSafeArea.Left;
            titleSafeTop = screenManager.GraphicsDevice.Viewport.TitleSafeArea.Top;
            titleSafeBottom = screenManager.GraphicsDevice.Viewport.TitleSafeArea.Bottom;
            titleSafeRight = screenManager.GraphicsDevice.Viewport.TitleSafeArea.Right;

            player = new UserControlledSprite(content.Load<Texture2D>(@"images\player1"),
            new Vector2(screenWidth / 2, screenHeight / 2),
            new Point(156, 128), 10, new Point(1, 1), new Point(4, 1), new Vector2(6, 6), 120);

            #if(XBOX360)
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 65, titleSafeTop + 10),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 65, titleSafeTop + 80),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 65, titleSafeTop + 150),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            #else
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 100, titleSafeTop + 30),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 100, titleSafeTop + 100),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            lifeList.Add(new MeatSprite(content.Load<Texture2D>(@"images\parm"), 0, new Vector2(titleSafeRight - 100, titleSafeTop + 170),
                                new Point(65, 65), 0, new Point(0, 0), new Point(0, 0), new Vector2(0, 0)));
            #endif
        }
Ejemplo n.º 26
0
 public override void Initialize(GraphicsDevice Device, ScreenManager manager)
 {
     base.Initialize(Device, manager);
     Settings.LoadSettings();
     Panel panel = new Panel(this, new Vector2(300, 160), new Vector2(200, 280), Content.ContentInterface.LoadTexture("UITest"));
     Button button = new Button(this, new Vector2(60, 30), new Vector2(80, 40), Content.ContentInterface.LoadTexture("UITest"),
         delegate { Settings.ServerAddress = "localhost";
             _manager.RemoveScreen(this); GameScreen screen = new GameScreen();
             screen.SetupLocalServer(); _manager.AddScreen(screen); },
         "Local");
     AddChild(panel);
     panel.AddChild(button);
     button = new Button(this, new Vector2(20, 90), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
     delegate { _manager.RemoveScreen(this); _manager.AddScreen(new GameScreen()); },
     "Online");
     panel.AddChild(button);
     button = new Button(this, new Vector2(20, 150), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
     delegate { Console.WriteLine("Test2"); },
     "Testbutton2");
     panel.AddChild(button);
     button = new Button(this, new Vector2(20, 210), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
     delegate { Console.WriteLine("Test3"); },
     "Testbutton3");
     panel.AddChild(button);
 }
Ejemplo n.º 27
0
        /// <summary>
        /// A Bubbles transition
        /// </summary>
        /// <param name="sceneManager">The <c>SceneManager</c></param>
        public Pixelize(ScreenManager sceneManager)
            : base(sceneManager)
        {
            waitTime = 200;
            div = 5;

            larguraColuna = viewport.Height / div;
            alturaLinha = viewport.Height / div;

            colunas = (viewport.Width / larguraColuna) + 1;
            linhas = viewport.Height / alturaLinha;

            int larguratotal = larguraColuna * colunas;
            offset = (larguratotal - viewport.Width) / 2;

            quant = colunas * linhas;

            quadrados = new List<Quadrado>(quant);
            posicoes = new List<Vector2>(quant);

            for (int i = 0; i < colunas; i++)
                for (int j = 0; j < linhas; j++)
                    posicoes.Add(new Vector2((i*larguraColuna)-offset, (j*alturaLinha)));

            newsize = new Vector2(larguraColuna, alturaLinha);
        }
        public override void LoadContent(bool tutorial = false, ScreenManager.ScreenManager screenManagerController = null)
        {
            base.LoadContent(tutorial, screenManagerController);

            Escala = new Vector2(3, 3);
            Sprite = new Rectangle(0, 0, 20, 20);
        }
Ejemplo n.º 29
0
		public Puzzle3D() {
			if( mInstance != null )
				throw new InvalidOperationException( "Only one instance of Puzzle3D may be created." );

			mInstance = this;

			graphics = new GraphicsDeviceManager( this );
			graphics.MinimumVertexShaderProfile = ShaderProfile.VS_2_0;
			graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;

			graphics.PreferredBackBufferWidth = 800;
			graphics.PreferredBackBufferHeight = 600;
			Window.AllowUserResizing = true;
			graphics.IsFullScreen = false;

			Content.RootDirectory = "Content";

			ScreenManager screenManager = new ScreenManager( this );
			Components.Add( screenManager );

			PictureDatabase.Initialize();
			if( PictureDatabase.Count >= 2 ) {
				screenManager.AddScreen( new MainMenuScreen() );
			} else {
				MessageBoxScreen messageBox = new MessageBoxScreen( "Unable to find enough pictures to play.", false );
				messageBox.Accepted += new EventHandler<EventArgs>( messageBox_Accepted );
				screenManager.AddScreen( messageBox );
			}
		}
Ejemplo n.º 30
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            GameServices.AddService<GraphicsDeviceManager>(graphics);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferHeight = (int)(1080);
            graphics.PreferredBackBufferWidth = (int)(1920);

            graphics.PreferredBackBufferHeight = (int)(720);
            graphics.PreferredBackBufferWidth = (int)(1280);

            graphics.IsFullScreen = false;

            Window.Title = "The Drunken Dream Maker (With a Cold)";

            ScreenManager = new ScreenManager(this);
            ScreenManager.initParameters();
            Components.Add(ScreenManager);

            SoundManager = new SoundManager(this);
            Components.Add(SoundManager);

            particleComponent = new ParticleComponent(this);
            Components.Add(particleComponent);

               // FrameRateCounter myFrameCounter = new FrameRateCounter(this, new Vector2(25, 25), Color.White, Color.Black);
               // Components.Add(myFrameCounter);
        }
Ejemplo n.º 31
0
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex);
 }
Ejemplo n.º 32
0
 /// <summary>
 /// 设置场景管理器引用
 /// </summary>
 public void SetScreenManager(ScreenManager scr)
 {
     this.Screen = scr;
 }
Ejemplo n.º 33
0
 public override void Draw(GameTime gameTime)
 {
     tileManager.BuildMap(typeof(LevelOne));
     tileManager.Draw(ScreenManager.GetInstance().SpriteBatch);
     base.Draw(gameTime);
 }
 static void Main(string[] args)
 {
     ScreenManager screen = new ScreenManager();
     //screen.printResults(new System.Collections.Generic.List<Student>());
 }
Ejemplo n.º 35
0
 void OnEnable()
 {
     loadingPanel.SetActive(true);
     scrnM = ScrManager.GetComponent <ScreenManager>();
     StartCoroutine(GetRefresh());
 }
Ejemplo n.º 36
0
 private void Awake()
 {
     _self = this;
 }
Ejemplo n.º 37
0
 private void Restart(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new GameplayScreen(), ControllingPlayer);
 }
Ejemplo n.º 38
0
        public override void LoadContent()
        {
            base.LoadContent();

            // Load the compiled map
            _map = Content.Load <TiledMap>("maps/Librarian");
            // Create the map renderer
            _mapRenderer = new TiledMapRenderer(GraphicsDevice, _map);

            foreach (var layer in _map.ObjectLayers)
            {
                if (layer.Name == "Arrivals")
                {
                    foreach (var obj in layer.Objects)
                    {
                        if (obj.Name == "from-city")
                        {
                            var objectPosition = obj.Position;

                            objectPosition.X = obj.Position.X + obj.Size.Width * 0.5f;
                            objectPosition.Y = obj.Position.Y + obj.Size.Height * 0.5f;


                            _player = HarvestMoon.Instance.RanchState.Entities.FirstOrDefault(e => e is Jack) as Jack;

                            if (_player == null)
                            {
                                _player = _entityManager.AddEntity(new Jack(Content, _entityManager, this, objectPosition));
                            }
                            else
                            {
                                _entityManager.AddEntity(_player);
                                _player.EntityManager = _entityManager;
                            }

                            _player.Position = new Vector2(objectPosition.X, objectPosition.Y);

                            _player.PlayerFacing = Jack.Facing.UP;
                        }
                    }
                }
                else if (layer.Name == "Walls")
                {
                    foreach (var obj in layer.Objects)
                    {
                        var objectPosition = obj.Position;

                        objectPosition.X = obj.Position.X + obj.Size.Width * 0.5f;
                        objectPosition.Y = obj.Position.Y + obj.Size.Height * 0.5f;

                        var objectSize = obj.Size;

                        _entityManager.AddEntity(new Wall(objectPosition, objectSize));
                    }
                }
                else if (layer.Name == "Doors")
                {
                    foreach (var obj in layer.Objects)
                    {
                        var objectPosition = obj.Position;

                        objectPosition.X = obj.Position.X + obj.Size.Width * 0.5f;
                        objectPosition.Y = obj.Position.Y + obj.Size.Height * 0.5f;

                        var objectSize = obj.Size;

                        var door = new Door(objectPosition, objectSize);
                        _entityManager.AddEntity(door);

                        door.OnTriggerStart(() =>
                        {
                            _player.Freeze();
                        });

                        if (obj.Name == "city")
                        {
                            door.OnTriggerEnd(() =>
                            {
                                if (!door.Triggered)
                                {
                                    door.Triggered = true;
                                    var screen     = new Town(Game, HarvestMoon.Arrival.Librarian);
                                    var transition = new FadeTransition(GraphicsDevice, Color.Black, 1.0f);
                                    ScreenManager.LoadScreen(screen, transition);
                                }
                            });
                        }
                    }
                }
                else if (layer.Name == "Interactables")
                {
                    foreach (var obj in layer.Objects)
                    {
                    }
                }
            }

            LoadPlayer();
        }
Ejemplo n.º 39
0
 public MainInterfaceScreen(ScreenManager sm, Rectangle b) : base(sm, b)
 {
     // list squads
     links.Add(InputCommand.S, new SquadInterfaceScreen(sm, b));
 }
Ejemplo n.º 40
0
        // Unlike the Update method, this will only be called when the gameplay screen is active.
        public override void HandleInput(GameTime gameTime, InputState input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            // Look up inputs for the active player profile.
            int playerIndex = (int)ControllingPlayer.Value;

            var keyboardState = input.CurrentKeyboardStates[playerIndex];
            var gamePadState  = input.CurrentGamePadStates[playerIndex];

            // The game pauses either if the user presses the pause button, or if
            // they unplug the active gamepad. This requires us to keep track of
            // whether a gamepad was ever plugged in, because we don't want to pause
            // on PC if they are playing with a keyboard and have no gamepad at all!
            bool gamePadDisconnected = !gamePadState.IsConnected && input.GamePadWasConnected[playerIndex];

            PlayerIndex player;

            if (_pauseAction.Occurred(input, ControllingPlayer, out player) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
            }
            else
            {
                // Otherwise move the player position.
                var movement = Vector2.Zero;

                if (keyboardState.IsKeyDown(Keys.Left))
                {
                    movement.X--;
                }

                if (keyboardState.IsKeyDown(Keys.Right))
                {
                    movement.X++;
                }

                if (keyboardState.IsKeyDown(Keys.Up))
                {
                    movement.Y--;
                }

                if (keyboardState.IsKeyDown(Keys.Down))
                {
                    movement.Y++;
                }

                var thumbstick = gamePadState.ThumbSticks.Left;

                movement.X += thumbstick.X;
                movement.Y -= thumbstick.Y;

                if (movement.Length() > 1)
                {
                    movement.Normalize();
                }

                _playerPosition += movement * 8f;
            }
        }
Ejemplo n.º 41
0
        public override void UpdateEntity(GameTime gameTime)
        {
            if (hungerLevel < 100)
            {
                EntColor = Color.Aqua;
            }
            else
            {
                EntColor = Color.White;
            }
            if (ScreenManager.coins.Count < 200)
            {
                if (HungerLevel > HUNGER_RATE)
                {
                    if (Misc.generaterValue(1, 1, DropRate) == 2)
                    {
                        ScreenManager.addCoin("golden_coin_" + gameTime.TotalGameTime, "golden_coin", new Vector2(Position.X, Position.Y), 10, Coins.COIN_MOVEMENT * (float)gameTime.ElapsedGameTime.TotalMilliseconds);
                    }
                }
                if (HungerLevel <= 0 || Health <= 0)
                {
                    ScreenManager.friendly.Remove(this);
                }
            }
            HungerLevel -= HUNGER_MODIFIER * (float)gameTime.ElapsedGameTime.TotalMilliseconds;//every 32 sec need feed or fish dies

            if (WanderingPoint == Vector2.Zero)
            {
                WanderingPoint = new Vector2(Misc.generaterValue(1, 50, ScreenManager.GraphicsDeviceMgr.PreferredBackBufferWidth - Texture.Width), Misc.generaterValue(1, (int)ScreenManager.water.GetHeight(Position.X), ScreenManager.GraphicsDeviceMgr.PreferredBackBufferHeight - Texture.Height));
                if ((float)gameTime.ElapsedGameTime.TotalMilliseconds > 0)
                {
                    CurrentMovementSpeed = FISH_MOVEMENT * (float)gameTime.ElapsedGameTime.TotalMilliseconds;
                }
            }

            foreach (var pill in ScreenManager.food.ToList())
            {
                if (HungerLevel < HUNGER_RATE)
                {
                    if (new Rectangle((int)Position.X, (int)Position.Y, Texture.Width, Texture.Height).Intersects(new Rectangle((int)pill.Position.X, (int)pill.Position.Y, (int)(pill.Texture.Width / Size), (int)(pill.Texture.Height / Size))))
                    {
                        HungerLevel = HungerLevel < 255 ? HungerLevel + EAT_MODIFIER : HungerLevel = 255;
                        Size--;
                        ScreenManager.food.Remove(pill);
                    }
                    //WanderingPoint = new Vector2(Misc.generaterValue(1, 50, ScreenManager.GraphicsDeviceMgr.PreferredBackBufferWidth - Texture.Width), Misc.generaterValue(1, (int)ScreenManager.water.GetHeight(Position.X), ScreenManager.GraphicsDeviceMgr.PreferredBackBufferHeight - Texture.Height));
                    if (pill.Position.Y >= ScreenManager.water.GetHeight(pill.Position.X))
                    {
                        WanderingPoint = getClosestPill();
                    }
                    CurrentMovementSpeed = (FISH_MOVEMENT * 2) * (float)gameTime.ElapsedGameTime.TotalMilliseconds; //twice as fast when fish find food
                    break;
                }
            }
            Position = moveNpcs(Position, WanderingPoint);
            float distance = Vector2.Distance(Position, WanderingPoint);

            if (distance < 5)
            {
                WanderingPoint = Vector2.Zero;
            }
            pillList.Clear();
        }
Ejemplo n.º 42
0
 public GameplayScreen()
 {
     tileManager = TileManager.GetInstance();
     mario       = new Mario(ScreenManager.GetInstance().Game);
     ScreenManager.GetInstance().Game.Components.Add(mario);
 }
Ejemplo n.º 43
0
        /// <summary>
        /// Updates the stage.
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            float dt = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            StageTimer       += dt;
            spawnTimer       += dt;
            vortexSpawnTimer += dt;
            CurrentDialogue?.Update(gameTime);

            if (!isOver)
            {
                base.Update(gameTime);
            }
            else
            {
                for (int i = 0; i < Players.Length; i++)
                {
                    if (Players[i] != null)
                    {
                        Players[i].Position += new Vector2(0, -5);
                    }
                }
            }

            switch (StageNumber)
            {
            case 1:
                if (StageTimer >= 5000f)
                {
                    SetStage(StageNumber + 1);
                    MediaPlayer.Play(cosmoFunk);
                }
                break;

            case 0:
                CurrentDialogue = Dialogues[0];

                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 2:
                CurrentDialogue = Dialogues[1];

                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 3:
                // spawn robots with invis
                if (spawnTimer > 700f)
                {
                    spawnTimer = 0;
                    if (rand.NextDouble() > .50 || StageTimer < 7000f)
                    {
                        SpawnInvisSinEnemy(new Vector2(-100, rand.Next(100, 500)), true);
                    }
                    else if (StageTimer > 7000f)
                    {
                        SpawnInvisSinEnemy(new Vector2(ScreenManager.GetInstance().Width + 100, rand.Next(100, 500)), false);
                    }

                    if (vortexSpawnTimer > 9000 && StageTimer > 18000f)
                    {
                        vortexSpawnTimer = 0;
                        SpawnVortexEnemy(new Vector2(-100, -100), new Vector2(200, 200), 7000f);
                        SpawnVortexEnemy(new Vector2(ScreenManager.GetInstance().Width + 100, -100), new Vector2(-200, 200), 7000f);
                    }

                    if (StageTimer > 36000f)
                    {
                        SetStage(StageNumber + 1);
                    }
                }

                break;

            case 4:
                CurrentDialogue = Dialogues[2];

                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 5:
                if (StageTimer >= 5000f)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 6:
                // summon asteroid hell upon the players
                if (spawnTimer > 70 && StageTimer < 30000)
                {
                    spawnTimer = 0;
                    Vector2   pos    = new Vector2(rand.Next(-100, ScreenManager.GetInstance().Width + 100), -90);
                    float     scale  = (float)(rand.NextDouble() * (Sprite.SCALE - 3) + 3f);
                    float     speed  = 1000 / (float)Math.Sqrt(scale);
                    Texture2D aster  = asteroidTextures[rand.Next(0, 5)];
                    float     xSpeed = (float)((rand.NextDouble() - 0.5f) * 100f);
                    Asteroid  a      = new Asteroid(Bullet.EntitySide.ENEMY, 7000f, new Vector2(xSpeed, speed))
                    {
                        Texture      = aster,
                        Position     = pos,
                        Size         = new Point((int)(aster.Width * scale), (int)(aster.Height * scale)),
                        Health       = (int)(Math.Ceiling(scale / 2)),
                        Color        = Color.White,
                        InitVelocity = new Vector2(xSpeed, speed),
                    };
                    Bullets.Add(a);
                }

                if (StageTimer > 33000)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 7:
                CurrentDialogue = Dialogues[3];

                if (CurrentDialogue.FinishedPlaying)
                {
                    Texture2D asteroidBoss = Content.Load <Texture2D>("AsteroidBoss");
                    aBoss = new AsteroidBoss(Players, 70 + GetPlayerCount() * 30)
                    {
                        Texture       = asteroidBoss,
                        Position      = new Vector2(ScreenManager.GetInstance().Width / 2, -300),
                        Size          = new Point(asteroidBoss.Width * Sprite.SCALE, asteroidBoss.Height * Sprite.SCALE),
                        BulletTexture = asteroidTextures[3],
                    };

                    AddEnemy(aBoss);
                    SetStage(StageNumber + 1);
                }
                break;

            case 8:
                if (StageTimer >= 5000f)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 9:
                if (aBoss != null && !aBoss.IsActive)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 10:
                CurrentDialogue = Dialogues[4];
                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 11:
                CurrentDialogue = Dialogues[5];
                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                CurrentDialogue = Dialogues[5];
                break;

            case 12:
                CurrentDialogue = Dialogues[6];
                if (CurrentDialogue.FinishedPlaying)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 13:
                if (StageTimer >= 5000f)
                {
                    SetStage(StageNumber + 1);
                }

                break;

            case 14:
                sBoss = new SpinnerBoss(Players, 100 + GetPlayerCount() * 50)
                {
                    Position = new Vector2(100, 100),
                };
                AddEnemy(sBoss);
                SetStage(StageNumber + 1);
                break;

            case 15:
                // SPAWN SPINNER BOSS
                if (Enemies.Count == 0)
                {
                    SetStage(StageNumber + 1);
                }
                break;

            case 16:
                CurrentDialogue = Dialogues[7];
                if (CurrentDialogue.FinishedPlaying)
                {
                    isOver = true;
                    bool isReallyOver = false;
                    for (int i = 0; i < Players.Length; i++)
                    {
                        if (Players[i] != null && Players[i].Position.Y > 0)
                        {
                            isReallyOver = false;
                            break;
                        }
                        else
                        {
                            isReallyOver = true;
                        }
                    }

                    // now end level
                    if (isReallyOver)
                    {
                        ScreenManager.GetInstance().ChangeScreen(ScreenState.AFTER);
                        AfterScreen s = (AfterScreen)ScreenManager.GetInstance().CurrentScreen;
                        s.Players = Players;
                        s.Stage   = 1;
                        MediaPlayer.Stop();
                    }
                }
                break;
            }
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            ScreenManager.Update(gameTime.ElapsedGameTime.Milliseconds);

            base.Update(gameTime);
        }
Ejemplo n.º 45
0
 public RandomTransition(ScreenManager sceneManager, List <TransitionScreen> list) : base(sceneManager)
 {
     t = list[RandomHelper.RandomInt(0, list.Count)];
 }
Ejemplo n.º 46
0
 public Level2StartCutScene(ScreenManager screenManager, string dataAsset, GameplayScreen gameplayScreen)
     : base(screenManager, dataAsset, gameplayScreen)
 {
 }
Ejemplo n.º 47
0
 void MapEditorMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new MapEditorMenuScreen(), e.PlayerIndex);
 }
Ejemplo n.º 48
0
 internal static void SetUpScene()
 {
     ScreenManager.AddScreen(new Screens.LoginScreen());
 }
 protected override void OnDeactivate()
 {
     base.OnDeactivate();
     _gauntletLayer.IsFocusLayer = false;
     ScreenManager.TryLoseFocus(_gauntletLayer);
 }
Ejemplo n.º 50
0
 public void Render(ScreenManager screen)
 {
     screen.Render(sprite, body);
 }
Ejemplo n.º 51
0
 public StartMenu(Game game, ScreenManager screenManager)
     : base(game)
 {
     content            = Game.Content;
     this.screenManager = screenManager;
 }
Ejemplo n.º 52
0
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new GameSelectScreen(), e.PlayerIndex);
 }
Ejemplo n.º 53
0
 /// <summary>
 /// Handles "Exit" menu item selection
 /// </summary>
 ///
 protected override void OnCancel(PlayerIndex playerIndex)
 {
     AudioManager.StopSounds();
     ScreenManager.AddScreen(new MainMenuScreen(), null);
     ExitScreen();
 }
 protected override void OnActivate()
 {
     base.OnActivate();
     ScreenManager.TrySetFocus(_gauntletLayer);
 }
Ejemplo n.º 55
0
        /// <summary>
        ///     Creates the selection buttons to navigate from test screens.
        /// </summary>
        private void CreateSelectionButtons()
        {
            var screen          = (SelectionScreen)Screen;
            var buttonsInColumn = (int)((WindowManager.VirtualScreen.Y - ButtonGap) / (ButtonSize.Y.Value + ButtonGap));

            var i = 0;

            foreach (var testScreens in screen.TestCasesScreens)
            {
                // Create a generic text button.
                var button = new TextButton(WobbleAssets.WhiteBox, "exo2-medium", testScreens.Value, 12)
                {
                    Parent = Container,
                    Size   = ButtonSize,
                    Text   =
                    {
                        Tint = Color.Black,
                    },
                    X = (i / buttonsInColumn) * (ButtonGap + ButtonSize.X.Value) + ButtonGap,
                    Y = (i % buttonsInColumn) * (ButtonGap + ButtonSize.Y.Value) + ButtonGap,
                };

                switch (testScreens.Key)
                {
                case ScreenType.DrawingSprites:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestDrawingSpritesScreen());
                    break;

                case ScreenType.EasingAnimations:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestEasingAnimationsScreen());
                    break;

                case ScreenType.Audio:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestAudioScreen());
                    break;

                case ScreenType.Discord:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestDiscordScreen());
                    break;

                case ScreenType.Background:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBackgroundImageScreen());
                    break;

                case ScreenType.Scrolling:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestScrollContainerScreen());
                    break;

                case ScreenType.BlurContainer:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBlurContainerScreen());
                    break;

                case ScreenType.BlurredBackgroundImage:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBlurredBackgroundImageScreen());
                    break;

                case ScreenType.TextInput:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestTextInputScreen());
                    break;

                case ScreenType.SpriteMaskContainer:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestSpriteMaskingScreen());
                    break;

                case ScreenType.BitmapFont:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBitmapFontScreen());
                    break;

                case ScreenType.Primitives:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestPrimitivesScreen());
                    break;

                case ScreenType.ImGui:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestImGuiScreen());
                    break;

                case ScreenType.Scaling:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestScalingScreen());
                    break;

                case ScreenType.TextSizes:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestTextSizesScreen());
                    break;

                case ScreenType.TaskHandler:
                    button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TaskHandlerScreen());
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                i++;
            }
        }
Ejemplo n.º 56
0
 public void OpenPauseScreen()
 {
     Log.Message("Нажатие на кнопку <Pause>.");
     ScreenManager.OpenScreen(ScreenType.PauseScreen);
 }
Ejemplo n.º 57
0
 public MenuController(ScreenManager screen) : base(screen)
 {
     this.characterHover  = new Dictionary <int, ImageModel>();
     this.playerHoversMap = new Dictionary <int, int>();
 }
Ejemplo n.º 58
0
 public UnderSiegeCreditsScreen(ScreenManager screenManager)
     : base(screenManager, "Data\\Screens\\TrailerFadeOutScreen")
 {
 }
Ejemplo n.º 59
0
 /// <summary>
 /// Constructor is used when game play is over and GamePlayController creates the menu controller agian
 /// </summary>
 public MenuController(ScreenManager screen, List <PlayerStats> gameStats)
     : this(screen)
 {
     this.gameStats     = gameStats;
     this.gameStatsText = new List <TextBox>();
 }
Ejemplo n.º 60
0
 /// <summary>
 ///
 /// </summary>
 void HelpMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new ControlMenuScreen(), e.PlayerIndex);
 }