Beispiel #1
0
        public override void Initialize()
        {
            Viewport viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;

            Crosshairs   = Resources.Menus.HUD.Crosshairs;
            RCrosshairs  = new Rectangle(0, 0, Crosshairs.Width, Crosshairs.Height);
            RCrosshairs2 = new Rectangle(0, 0, Crosshairs.Width / 2, Crosshairs.Height / 2);
            nearbyShips  = Sector.Redria.Ships.GetTable();

            Texture2D tex = Resources.Menus.HUD.NoseHealth;
            Rectangle dim = new Rectangle(viewport.Width - 100 - tex.Width / 2, 35, tex.Width, tex.Height);

            NoseHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(NoseHealth);
            int offset = tex.Height;

            tex        = Resources.Menus.HUD.CoreHealth;
            dim        = new Rectangle(viewport.Width - 100 - tex.Width / 2, 35 + offset, tex.Width, tex.Height);
            CoreHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(CoreHealth);
            offset += tex.Height;

            tex          = Resources.Menus.HUD.EngineHealth;
            dim          = new Rectangle(viewport.Width - 100 - tex.Width / 2, 35 + offset, tex.Width, tex.Height);
            EngineHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(EngineHealth);

            SetHealth(600);

            enemyMissileSound          = Resources.Sounds.EnemyMissile.CreateInstance();
            enemyMissileSound.IsLooped = true;
        }
Beispiel #2
0
        public override void Initialize()
        {
            Viewport viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;
            Crosshairs = Resources.Menus.HUD.Crosshairs;
            RCrosshairs = new Rectangle(0, 0, Crosshairs.Width, Crosshairs.Height);
            RCrosshairs2 = new Rectangle(0, 0, Crosshairs.Width/2, Crosshairs.Height/2);
            nearbyShips = Sector.Redria.Ships.GetTable();

            Texture2D tex = Resources.Menus.HUD.NoseHealth;
            Rectangle dim = new Rectangle(viewport.Width - 100 - tex.Width / 2, 35, tex.Width, tex.Height);
            NoseHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(NoseHealth);
            int offset = tex.Height;

            tex = Resources.Menus.HUD.CoreHealth;
            dim = new Rectangle(viewport.Width - 100 - tex.Width / 2, 35 + offset, tex.Width, tex.Height);
            CoreHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(CoreHealth);
            offset += tex.Height;

            tex = Resources.Menus.HUD.EngineHealth;
            dim = new Rectangle(viewport.Width - 100 - tex.Width/2, 35 + offset, tex.Width, tex.Height);
            EngineHealth = new UIHealthIndicator(this, tex, dim);
            Manager.Elements.Add(EngineHealth);

            SetHealth(600);

            enemyMissileSound = Resources.Sounds.EnemyMissile.CreateInstance();
            enemyMissileSound.IsLooped = true;
        }