示例#1
0
文件: Settings.cs 项目: voidel/mobo
        public void Draw(SpriteBatch spriteBatch)
        {
            // Draw background
            background.Draw(spriteBatch);

            // Draw buttons
            foreach (Button button in menuButtons)
            {
                button.Draw(spriteBatch);
            }

            // Draw fields
            foreach (Field field in menuFields)
            {
                switch (field.id)
                {
                case 0: field.Draw(spriteBatch, SettingsManager.getUsername()); break;

                case 1: field.Draw(spriteBatch, SettingsManager.getVerboseDifficulty()); break;

                case 2: field.Draw(spriteBatch, SettingsManager.getResolutionWidth() + "x" + SettingsManager.getResolutionHeight()); break;

                case 8: field.Draw(spriteBatch, SettingsManager.getShowDebug().ToString()); break;

                case 9: field.Draw(spriteBatch, SettingsManager.getShowBounds().ToString()); break;

                case 10: field.Draw(spriteBatch, SettingsManager.getShowDepths().ToString()); break;

                default: field.Draw(spriteBatch, "No value"); break;
                }
            }
        }
示例#2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (texture != null)
            {
                spriteBatch.Draw(texture, position, null, color, 0f, origin, 1f, SpriteEffects.None, 0f);

                if (SettingsManager.getShowDepths())
                {
                    spriteBatch.DrawString(ContentStore.generic, node.depth.ToString(), position, Color.White);
                }

                if (SettingsManager.getShowBounds())
                {
                    if (nodeType == StationNodeType.Turret)
                    {
                        spriteBatch.Draw(ContentStore.debug, bounds, Color.Red);
                    }
                    else
                    {
                        // Collision rectangle
                        spriteBatch.Draw(ContentStore.debug, bounds, Color.White);
                    }
                }

                if (explosion != null)
                {
                    explosion.Draw(spriteBatch, position);
                    color = new Color(120, 120, 120);
                }

                if (nodeType == StationNodeType.Turret)
                {
                    spriteBatch.Draw(ContentStore.station_shield, position, null, Color.White, rotation++, origin, 0.15f, SpriteEffects.None, 0f);
                }
            }

            //Draw projectiles
            foreach (Projectile projectile in projectiles.Values)
            {
                if (projectile != null)
                {
                    // Draw projectiles
                    projectile.Draw(spriteBatch);
                }
            }
        }
示例#3
0
        public void Draw(SpriteBatch spriteBatch)
        {
            background.Draw(spriteBatch);

            if (station != null)
            {
                station.Draw(spriteBatch);

                if (SettingsManager.getShowDepths())
                {
                    spriteBatch.DrawString(ContentStore.generic, station.debug_size.ToString(), Vector2.Zero, Color.White);
                    spriteBatch.DrawString(ContentStore.generic, station.debug_string, Vector2.Zero, Color.White);
                }
            }

            // Draw buttons
            foreach (Button button in menuButtons)
            {
                button.Draw(spriteBatch);
            }

            // Draw fields
            foreach (Field field in menuFields)
            {
                switch (field.id)
                {
                case 0: field.Draw(spriteBatch, "Size: " + size); break;

                case 1: field.Draw(spriteBatch, "Difficulty: " + difficulty); break;

                case 2: field.Draw(spriteBatch, "Max Branches: " + branches); break;

                case 3: field.Draw(spriteBatch, "Show Depths: " + SettingsManager.getShowDepths().ToString()); break;
                }
            }
        }