예제 #1
0
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _exit.ButtonGraphic.Initialize(new Vector2(screenWidth - 360, 50), 340, 25, 1, 100, Color.White);
            _previousPage.ButtonGraphic.Initialize(new Vector2(0, 50), 340, 25, 1, 100, Color.White);

            if (Window.Context.Players.Count == 0)
            {
                _players[0, 0].Initialize(new Vector2(screenWidth / 2, screenHeight / 2));
            }
            else
            {
                for (int i = 0; i < _players.GetLength(0); i++)
                {
                    _players[i, 0].Initialize(new Vector2((screenWidth / 2) - 150, 230 + i * 40));
                    _players[i, 1].Initialize(new Vector2((screenWidth / 2) + 160, 230 + i * 40));
                    if (i % 2 != 0)
                    {
                        _players[i, 0].Color = _players[i, 1].Color = Color.White;
                    }
                    else
                    {
                        _players[i, 0].Color = _players[i, 1].Color = Color.Yellow;
                    }
                }
            }

            _header.Initialize(new Vector2(screenWidth / 2, 150));
            _logo.Initialize(new Vector2((screenWidth - _logo.Image.Width) / 2, 20), Color.White);
        }
예제 #2
0
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, screenHeight, screenWidth, screenHeight), Color.White);
        }
예제 #3
0
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _logo.Initialize(new Vector2((screenWidth - _logo.Image.Width) / 2, 20), Color.White);
            _goToMainMenuButton.ButtonGraphic.Initialize(new Vector2((screenWidth - 340) / 2, (screenHeight / 2) + 100), 340, 25, 1, 100, Color.White);
            _infoLabel.Initialize(new Vector2(screenWidth / 2, 300));
            _tryAgain.ButtonGraphic.Initialize(new Vector2((screenWidth - 350) / 2, 420), 370, 72, 1, 100, Color.White);
        }
예제 #4
0
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _exit.ButtonGraphic.Initialize(new Vector2(screenWidth - 360, 50), 340, 25, 1, 100, Color.White);
            _previousPage.ButtonGraphic.Initialize(new Vector2(0, 50), 340, 25, 1, 100, Color.White);

            _instruction.Initialize(new Vector2((screenWidth - _instruction.Image.Width) / 2, 240), Color.White);

            _header.Initialize(new Vector2(screenWidth / 2, 150));
            _logo.Initialize(new Vector2((screenWidth - _logo.Image.Width) / 2, 20), Color.White);
        }
예제 #5
0
파일: NewGame.cs 프로젝트: kubek96/PI
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _menuFrame.Initialize(new Vector2((screenWidth - _menuFrame.Image.Width) / 2, (screenHeight - _menuFrame.Image.Height) / 2), Color.White);

            _menu[0].ButtonGraphic.Initialize(new Vector2((screenWidth / 2) + 80, (screenHeight / 2) + 150), _menu[0].ButtonGraphic.Image.Width / 3, _menu[0].ButtonGraphic.Image.Height, 1, 100, Color.White);
            _menu[1].ButtonGraphic.Initialize(new Vector2((screenWidth / 2) - 300, (screenHeight / 2) + 150), 340, 25, 1, 100, Color.White);
            _menu[2].ButtonGraphic.Initialize(new Vector2(screenWidth - 360, 20), 340, 25, 1, 100, Color.White);

            // UserInput
            _userName.Initialize(new Vector2(screenWidth / 2, screenHeight / 2));
        }
예제 #6
0
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _exit.ButtonGraphic.Initialize(new Vector2(screenWidth - 360, 50), 340, 25, 1, 100, Color.White);
            _continue.ButtonGraphic.Initialize(new Vector2(0, 50), 340, 25, 1, 100, Color.White);

            for (int i = 0; i < _menu.Length; i++)
            {
                _menu[i].ButtonGraphic.Initialize(new Vector2((screenWidth - 340) / 2, 420 + i * 50), 340, 25, 1, 100, Color.White);
            }

            _header.Initialize(new Vector2(screenWidth / 2, 150));
            _logo.Initialize(new Vector2((screenWidth - _logo.Image.Width) / 2, 20), Color.White);
        }
예제 #7
0
파일: Options.cs 프로젝트: kubek96/PI
        /// <summary>
        /// Metoda inicjalizująca obiekty interfejsu użytkownika.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
            _exit.ButtonGraphic.Initialize(new Vector2(screenWidth - 360, 50), 340, 25, 1, 100, Color.White);
            _goBack.ButtonGraphic.Initialize(new Vector2(0, 50), 340, 25, 1, 100, Color.White);

            _keyboardLabel.Initialize(new Vector2(screenWidth / 2, 320));
            _keyboardLayout[0].ButtonGraphic.Initialize(new Vector2((screenWidth - 460) / 2, 360), 230, 25, 1, 100, Color.White);
            _keyboardLayout[1].ButtonGraphic.Initialize(new Vector2((screenWidth) / 2, 360), 230, 25, 1, 100, Color.White);

            _musicLabel.Initialize(new Vector2(screenWidth / 2, 520));
            _musicOnOff[0].ButtonGraphic.Initialize(new Vector2((screenWidth - 300) / 2, 560), 150, 25, 1, 100, Color.White);
            _musicOnOff[1].ButtonGraphic.Initialize(new Vector2((screenWidth) / 2, 560), 150, 25, 1, 100, Color.White);

            _header.Initialize(new Vector2(screenWidth / 2, 150));
            _logo.Initialize(new Vector2((screenWidth - _logo.Image.Width) / 2, 20), Color.White);
        }
예제 #8
0
파일: Menu.cs 프로젝트: kubek96/PI
        /// <summary>
        /// Metoda inicjalizująca widok menu.
        /// Ustawia na odpowiednie pozycje wszystkie obiekty graficzne.
        /// </summary>
        public void Initialize()
        {
            int screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            int screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

            _background.Initialize(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);

            _grass[0].Initialize(new Vector2(0, 160), Color.White, screenWidth, 1);
            _grass[1].Initialize(new Vector2(0, 160 - 7), Color.White, screenWidth, -1);
            _grass[2].Initialize(new Vector2(0, 160 - 12), Color.White, screenWidth, -2);

            _sky.Initialize(Vector2.Zero, Color.White);
            _cloud.Initialize(new Vector2(0, 30), Color.White, screenWidth, -1);
            _groundBuffer.Initialize(new Vector2(0, 229), Color.White);

            _menuFrame.Initialize(new Vector2((screenWidth - _menuFrame.Image.Width) / 2, 320), Color.White);
            int nextPosition = 490;

            for (int i = 0; i < _menu.Length; i++)
            {
                _menu[i].ButtonGraphic.Initialize(new Vector2((screenWidth - 340) / 2, nextPosition), 340, 25, 1, 100, Color.White);
                nextPosition += _menu[i].ButtonGraphic.FrameHeight + 15;
            }
        }
예제 #9
0
 /// <summary>
 /// Metoda inicjalizująca pozycję grudki ziemi.
 /// </summary>
 /// <param name="position">Pozycja.</param>
 /// <param name="groundType">Typ ziemi w jakim ma obecnie ona się pokazywać.</param>
 public void Initialize(Vector2 position, GroundType groundType = GroundType.Normal)
 {
     _groundType = groundType;
     _groundGraphic.Initialize(position, Color.White);
     _freeGroundGraphic.Initialize(position, Color.White);
 }
예제 #10
0
파일: Fruit.cs 프로젝트: kubek96/PI
 /// <summary>
 /// Metoda inicjalizująca położenie owocu.
 /// </summary>
 /// <param name="rectangle">Obszar, który ma być zajmowany przez owoc.</param>
 public void Initialize(Rectangle rectangle)
 {
     _rectangle = rectangle;
     _fruitGraphic.Initialize(_rectangle, Color.White);
 }