Пример #1
0
        public override void Enter()
        {
            for (int i = 0; i < options.Length; ++i)
            {
                options[i] = new TextComponent(100, 100 * (i + 1), OPTIONS[i], "KartsFont");
                menu.AddComponent(options[i]);
                FaderEffect fader = new FaderEffect(options[i], 2000, false, 0, 255);
                Gui.GetInstance().AddEffect(fader);
                fader.setEnabled(true);
            }

            Gui.GetInstance().AddComponent(menu);

            UpdateSelected();

            base.Enter();
        }
Пример #2
0
 private void UpdateList()
 {
     menu.RemoveAll();
     int index = 0;
     foreach (Player player in PlayerManager.GetInstance().GetPlayers())
     {
         TextComponent comp = new TextComponent(100, 150 + index * 50, player.GetName());
         players.Add(comp);
         menu.AddComponent(comp);
         index++;
     }
 }
Пример #3
0
        public Player CreatePlayer(UInt32 uID)
        {
            Player newPlayer = GetPlayerByID(uID);

            if (newPlayer != null)
            {
                // the id already in use!! Something is wrong!
                return null;
            }

            newPlayer = new Player();
            m_PlayerList.Add(newPlayer);

            TextComponent rank = new TextComponent(10, 10 + 30*(m_Ranking.Count+1), "", "kartsFont");
            m_Ranking.Add(rank);
            Gui.GetInstance().AddComponent(rank);

            return newPlayer;
        }
Пример #4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            ResourcesManager resources = ResourcesManager.GetInstance();
            resources.Init(this.Content, this.graphics);

            Components.Add(Gui.Init(this));
            Components.Add(CameraManager.Init(this));

            /*
            InputManager.GetInstance().UpdateOrder = 0;
            GameStateManager.GetInstance().UpdateOrder = 10;
            NetworkManager.GetInstance().UpdateOrder = 20;
            //PlayerManager.GetInstance().UpdateOrder = 30;
            //CircuitManager.GetInstance().UpdateOrder = 35;
            CameraManager.GetInstance().UpdateOrder = 40;
            Gui.GetInstance().UpdateOrder = 50;
            */

            GameStateManager.GetInstance().ChangeState(new MainMenu());
            //GameStateManager.GetInstance().ChangeState(new GameplayState());

            fps = new TextComponent(10, 10, "FPS:", "kartsFont");
            Gui.GetInstance().AddComponent(fps);

            defaultViewport = GraphicsDevice.Viewport;
        }