public static void Draw(SpriteBatch spriteBatch, int screenwidth, int screenheight)
        {
            spriteBatch.Draw(Textures.Pixel_, new Rectangle(0, 0, screenwidth, screenheight), new Color(0, 0, 0, 0.75f));
            spriteBatch.DrawString(Textures.Font_, titles_[menu_], Vector2.Zero + new Vector2(0, 0), Color.Gray);
            int i = 0;

            foreach (var item in menus_[menu_].Skip(offset_).Take(rows_))
            {
                Vector2 text_size = Textures.Font_.MeasureString(item.Value.Item1_);
                spriteBatch.Draw(Textures.Pixel_, new Rectangle(state_ == item.Key ? 30 : 0, i * 30 + 30, (int)text_size.X, (int)text_size.Y), new Color(0, 0, 0, 0.75f));
                spriteBatch.DrawString(Textures.Font_, item.Value.Item1_, new Vector2(state_ == item.Key ? 30 : 0, i * 30 + 30), Color.White);
                i++;
            }
            if (map_ != null && state_ != menus_[menu_].Count - 1)
            {
                map_.Draw(spriteBatch, new Vector2(Textures.Font_.MeasureString(titles_[0]).X + (max_width_ - map_.Width_ * size_) / 2, 10 + (max_height_ - map_.Height_ * size_) / 2), (int)size_);
            }
        }
Beispiel #2
0
        public static void Draw(SpriteBatch spriteBatch, int screenwidth, int screenheight)
        {
            map_.Draw(spriteBatch, screenwidth, screenheight);
            //mouseState_.X <= 100 && mouseState_.Y <= 60
            spriteBatch.Draw(Textures.Pixel_, new Rectangle(0 + (!side_ ? 0 : screenwidth - 105), 0, 105, 55), new Color(0, 0, 0, 128));
            spriteBatch.DrawString(Textures.Font_, "Layer: " + layer_, Vector2.Zero + (!side_ ? Vector2.Zero : new Vector2(screenwidth - 105, 0)), Color.White);
            spriteBatch.DrawString(Textures.Font_, "Content:", new Vector2(0, 30) + (!side_ ? Vector2.Zero : new Vector2(screenwidth - 105, 0)), Color.White);
            int[] content = { contents_[content_].Item1_, -1, -1 };
            new CellEditor(content).Draw(spriteBatch, (int)Textures.Font_.MeasureString("Content:").X + (!side_ ? 0 : screenwidth - 105), 30, 20);
            int n = 0;

            spriteBatch.Draw(Textures.Pixel_, new Rectangle(x_, 55, max_width_ + 30 + 5, 25 * contents_.Count() + 10), new Color(0, 0, 0, 128));
            foreach (var i in contents_)
            {
                if (content_ == n)
                {
                    spriteBatch.Draw(Textures.Pixel_, new Rectangle(x_ + 2, 65 + n * 25 - 3, max_width_ + 30 + 1, 26), new Color(0, 0, 0, 128));
                }
                int[] temp = { i.Item1_, -1, -1 };
                new CellEditor(temp).Draw(spriteBatch, 5 + x_, 65 + n * 25, 20);
                spriteBatch.DrawString(Textures.Font_, i.Item2_, new Vector2(30 + x_, 65 + n * 25), Color.White);
                n++;
            }
            if (MapChooser.Active_)
            {
                MapChooser.Draw(spriteBatch, screenwidth, screenheight);
            }
            else if (EditorOptions.Active_)
            {
                EditorOptions.Draw(spriteBatch, screenwidth, screenheight);
            }
            if (thread_part1_)
            {
                spriteBatch.Draw(Textures.Pixel_, new Rectangle(0, 0, screenwidth, screenheight), new Color(0f, 0f, 0f, shade_));
                Vector2 v = Textures.Font_.MeasureString(thread_part1_str_);
                spriteBatch.DrawString(Textures.Font_, thread_part1_str_, new Vector2(screenwidth, screenheight) / 2 - v / 2, new Color(1f, 1f, 1f, shade_));
            }
            else if (thread_part2_)
            {
                spriteBatch.Draw(Textures.Pixel_, new Rectangle(0, 0, screenwidth, screenheight), new Color(0f, 0f, 0f, shade_));
                Vector2 v = Textures.Font_.MeasureString(thread_part2_str_);
                spriteBatch.DrawString(Textures.Font_, thread_part2_str_, new Vector2(screenwidth, screenheight) / 2 - v / 2, new Color(1f, 1f, 1f, shade_));
            }
        }
Beispiel #3
0
        public static void Draw(SpriteBatch spriteBatch)
        {
            if (menu_ == 4 && map_ != null && state_ != menus_[menu_].Count - 1)
            {
                spriteBatch.Draw(Textures.Pixel_, new Rectangle((int)Textures.Font_.MeasureString(titles_[menu_]).X + (max_width_ - map_.Width_ * (int)size_) / 2 - 1, 10 + (max_height_ - map_.Height_ * (int)size_) / 2 - 1, map_.Width_ * (int)size_ + 2, map_.Height_ * (int)size_ + 2), Color.Gray);
                map_.Draw(spriteBatch, new Vector2(Textures.Font_.MeasureString(titles_[menu_]).X + (max_width_ - map_.Width_ * (int)size_) / 2, 10 + (max_height_ - map_.Height_ * (int)size_) / 2), (int)size_);
            }
            spriteBatch.DrawString(Textures.Font_, titles_[menu_], Vector2.Zero + new Vector2(0, 0), Color.Gray);
            int i = 0;

            foreach (var item in menus_[menu_].Skip(offset_).Take(rows_))
            {
                Vector2 text_size = Textures.Font_.MeasureString(item.Value.Item1_);
                spriteBatch.Draw(Textures.Pixel_, new Rectangle(state_ == item.Key ? 30 : 0, i * 30 + 30, (int)text_size.X, (int)text_size.Y), new Color(0, 0, 0, 0.75f));
                spriteBatch.DrawString(Textures.Font_, item.Value.Item1_, new Vector2(state_ == item.Key ? 30 : 0, i * 30 + 30), Color.White);
                i++;
            }
            Vector2 size  = Textures.Font_.MeasureString(GameHandler.Version_);
            Vector2 size2 = Textures.Font_.MeasureString("V" + GameHandler.Version_);

            spriteBatch.DrawString(Textures.Font_, "V", new Vector2(Drawer.Graphics_.PreferredBackBufferWidth, Drawer.Graphics_.PreferredBackBufferHeight) - size2, Color.White);
            spriteBatch.DrawString(Textures.Font_, GameHandler.Version_, new Vector2(Drawer.Graphics_.PreferredBackBufferWidth, Drawer.Graphics_.PreferredBackBufferHeight) - size, Color.Gray);
        }