コード例 #1
0
        private void DrawInfo(SpriteBatch spriteBatch)
        {
            float xOffset = 8;

            var missionType = level.GetMissionType();

            if (missionType == MissionType.alliancepirate || missionType == MissionType.rebelpirate)
            {
                String  lootString    = String.Format("Collected bounty: {0} Crebits", level.LevelLoot);
                Vector2 lootStringPos = new Vector2(xOffset, Game1.ScreenSize.Y - 123) + Game.fontManager.FontOffset;
                DrawStandardString(spriteBatch, shipInfoFontSmall, lootString, lootStringPos, Color.Yellow);
            }

            String  objectiveString    = level.GetObjectiveString();
            Vector2 objectiveStringPos = new Vector2(xOffset, Game1.ScreenSize.Y - 103) + Game.fontManager.FontOffset;

            DrawStandardString(spriteBatch, shipInfoFontSmall, objectiveString, objectiveStringPos, Color.White);

            String  primaryString    = "Primary: " + ShipInventoryManager.currentPrimaryWeapon.Name;
            Vector2 primaryStringPos = new Vector2(xOffset, Game1.ScreenSize.Y - 83) + Game.fontManager.FontOffset;

            DrawStandardString(spriteBatch, shipInfoFontSmall, primaryString, primaryStringPos, Color.White);

            String  secondaryString    = "Secondary: " + ShipInventoryManager.equippedSecondary.Name;
            Vector2 secondaryStringPos = new Vector2(xOffset, Game1.ScreenSize.Y - 68) + Game.fontManager.FontOffset;

            DrawStandardString(spriteBatch, shipInfoFontSmall, secondaryString, secondaryStringPos, Color.White);

            String  shipStatsNamesString    = "Health:\nEnergy:\nShield:";
            Vector2 shipStatsNamesStringPos = new Vector2(xOffset, Game1.ScreenSize.Y - 49) + Game.fontManager.FontOffset;

            DrawStandardString(spriteBatch, shipInfoFontSmall, shipStatsNamesString, shipStatsNamesStringPos, Color.White);
        }
コード例 #2
0
        private void DisplayLevelModeInformation(SpriteBatch spriteBatch)
        {
            float xBase = 350f;
            float yBase = 100f;

            String objectiveString = currentLevel.GetObjectiveString();

            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, "Level name: " + currentLevel.Identifier, new Vector2(xBase, yBase), Color.DarkOliveGreen);
            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, objectiveString, new Vector2(xBase, yBase + 20), Color.DarkOliveGreen);

            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, "Enemies killed: " + currentLevel.enemiesKilled, new Vector2(xBase, yBase + 40), Color.DarkOliveGreen);
            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, "Enemies escaped: " + currentLevel.enemiesLetThrough, new Vector2(xBase, yBase + 60), Color.DarkOliveGreen);
            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, "Enemy count: " + currentLevel.totalLevelEnemyCount, new Vector2(xBase, yBase + 80), Color.DarkOliveGreen);
            spriteBatch.DrawString(MapCreatorGUI.staticFontExperiment, "Elapsed time: " + currentLevel.PlayTimeRounded, new Vector2(xBase, yBase + 100), Color.DarkOliveGreen);
        }