Beispiel #1
0
        private Vector2 computeUISize(SmallPlayerUI ui, SpriteFont font)
        {
            float val = (float)MyGame.MapArea.X * 0.75f;

            return(new Vector2(val, val));
            //return font.MeasureString(" " + GameData.PlayerData.Instance[ui._player].Name + " ");
        }
Beispiel #2
0
 private Rectangle computeUIArea(SmallPlayerUI ui)
 {
     return(new Rectangle((int)(ui._position.X - ui._width / 2f),
                          (int)(ui._position.Y - ui._width / 2f), (int)ui._width, (int)ui._width));
 }
Beispiel #3
0
 private Vector2 computeUISize(SmallPlayerUI ui, SpriteFont font)
 {
     float val = (float)MyGame.MapArea.X * 0.75f;
     return new Vector2(val, val);
     //return font.MeasureString(" " + GameData.PlayerData.Instance[ui._player].Name + " ");
 }
Beispiel #4
0
        private void initializePlayerUIs()
        {
            //hack
            /*GameData.PlayerData.Instance[0].Name = "Gwenn";
            GameData.PlayerData.Instance[1].Name = "Aurel";
            GameData.PlayerData.Instance[2].Name = "Jerom";
            GameData.PlayerData.Instance[3].Name = "Bastien";*/

            _miniUIs = new List<SmallPlayerUI>();

            SmallPlayerUI playerUI = new SmallPlayerUI(_buttonTexture, new Vector2(50f, 50f), 0);
            _miniUIs.Add(playerUI);

            playerUI = new SmallPlayerUI(_buttonTexture, new Vector2(200f, 50f), 1);
            _miniUIs.Add(playerUI);

            playerUI = new SmallPlayerUI(_buttonTexture, new Vector2(400f, 50f), 2);
            _miniUIs.Add(playerUI);

            playerUI = new SmallPlayerUI(_buttonTexture, new Vector2(600f, 50f), 3);
            _miniUIs.Add(playerUI);

            //now that the font i s;oaded we can compute the size of each UI
            foreach (SmallPlayerUI ui in _miniUIs)
            {
                ui.initializeArea(MyGame.BasicFontSmall);
            }
        }
Beispiel #5
0
 private Rectangle computeUIArea(SmallPlayerUI ui)
 {
     return new Rectangle((int)(ui._position.X - ui._width / 2f),
         (int)(ui._position.Y - ui._width / 2f), (int)ui._width, (int)ui._width);
 }