Esempio n. 1
0
        private void CreateAmmoContainer()
        {
            ammoElement = OverlayManager.Singleton.CreateOverlayElement(
                "TextArea", "ammoElement " + DateTime.Now.Ticks);
            ammoContainer = (OverlayContainer)OverlayManager.Singleton.CreateOverlayElement(
                "Panel", "ammoContainer " + DateTime.Now.Ticks);


            int count = 0;

            switch (gameScreen.CurrentLevel.UserPlane.Weapon.SelectWeapon)
            {
            case WeaponType.Bomb:
                count = gameScreen.CurrentLevel.UserPlane.Weapon.BombCount;
                break;

            case WeaponType.Rocket:
                count = gameScreen.CurrentLevel.UserPlane.Weapon.RocketCount;
                break;

            case WeaponType.Torpedo:
                count = gameScreen.CurrentLevel.UserPlane.Weapon.TorpedoCount;
                break;
            }
            ConfigureElement(ammoElement, minimapViewport.ActualWidth, minimapViewport.ActualHeight, count.ToString());

            ConfigureContainer(ammoContainer, ammoElement,
                               minimapViewport.ActualWidth, minimapViewport.ActualHeight,
                               UnitConverter.AspectDependentHorizontalProportion(0.061f, viewport),
                               (int)(viewport.ActualHeight - minimapViewport.ActualHeight * 0.276f));
        }
Esempio n. 2
0
        private void CreateScoreContainer()
        {
            scoreElement = OverlayManager.Singleton.CreateOverlayElement(
                "TextArea", "scoreElement " + DateTime.Now.Ticks);
            scoreContainer = (OverlayContainer)OverlayManager.Singleton.CreateOverlayElement(
                "Panel", "scoreContainer " + DateTime.Now.Ticks);

            ConfigureElement(scoreElement, minimapViewport.ActualWidth, minimapViewport.ActualHeight,
                             gameScreen.Score.ToString());

            ConfigureContainer(scoreContainer, scoreElement,
                               minimapViewport.ActualWidth, minimapViewport.ActualHeight,
                               UnitConverter.AspectDependentHorizontalProportion(0.870f, viewport),
                               (int)(viewport.ActualHeight - minimapViewport.ActualHeight * 0.3725f));
        }
Esempio n. 3
0
        private void CreateLivesContainer()
        {
            livesElement = OverlayManager.Singleton.CreateOverlayElement(
                "TextArea", "livesElement " + DateTime.Now.Ticks);
            livesContainer = (OverlayContainer)OverlayManager.Singleton.CreateOverlayElement(
                "Panel", "livesContainer " + DateTime.Now.Ticks);

            ConfigureElement(livesElement, minimapViewport.ActualWidth, minimapViewport.ActualHeight,
                             gameScreen.CurrentLevel.Lives.ToString());

            ConfigureContainer(livesContainer, livesElement,
                               minimapViewport.ActualWidth, minimapViewport.ActualHeight,
                               UnitConverter.AspectDependentHorizontalProportion(0.1260f, viewport),
                               (int)(viewport.ActualHeight - minimapViewport.ActualHeight * 0.276f));
        }