public void draw(SpriteBatch sprite_batch)
        {
            Vector2 offset = this.loc + draw_vector();

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            // Window
            draw_window(sprite_batch);
            // Scroll Bar
            if (Scrollbar != null)
            {
                Scrollbar.draw(sprite_batch, -offset);
            }
            sprite_batch.End();

            // Map Sprites
            draw_units(sprite_batch);

            sprite_batch.GraphicsDevice.ScissorRectangle = Scene_Map.fix_rect_to_screen(Unit_Scissor_Rect);
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State);
            draw_selected_cursor(sprite_batch);
            sprite_batch.End();

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            if (Active)
            {
                UnitCursor.draw(sprite_batch, -draw_vector());
            }
            sprite_batch.End();
        }
Beispiel #2
0
        protected override void draw_window(SpriteBatch sprite_batch)
        {
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            // Scroll Bar
            if (Scrollbar != null)
            {
                Scrollbar.draw(sprite_batch);
            }
            Description_Window.draw(sprite_batch);
            Description.draw(sprite_batch);
            CancelButton.Draw(sprite_batch);
            Banner.draw(sprite_batch);
            Banner_Text.draw(sprite_batch);
            sprite_batch.End();
            // Labels
            sprite_batch.GraphicsDevice.ScissorRectangle = Scene_Map.fix_rect_to_screen(Data_Scissor_Rect);
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State);
            OptionsNodes.Draw(sprite_batch, Offset);
            SettingsNodes.Draw(sprite_batch, Offset);

            if (on_soloanim && SoloAnim_Allowed)
            {
                Solo_Icon.draw(sprite_batch);
            }
            sprite_batch.End();

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            // Cursor
            OptionsCursor.draw(sprite_batch);
            SettingsCursor.draw(sprite_batch);
            // Page Arrows
            Up_Page_Arrow.draw(sprite_batch);
            Down_Page_Arrow.draw(sprite_batch);
            sprite_batch.End();
        }
        protected override void draw_window(SpriteBatch sprite_batch)
        {
            base.draw_window(sprite_batch);

            if (Scrollbar != null)
            {
                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                Scrollbar.draw(sprite_batch, -(loc + draw_vector() + new Vector2(0, Text_Offset.Y)));
                sprite_batch.End();
            }
        }
Beispiel #4
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (DataDisplayed)
            {
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                Background.draw(spriteBatch);
                if (Scrollbar != null)
                {
                    Scrollbar.draw(spriteBatch);
                }
                spriteBatch.End();


                RasterizerState scissorState = new RasterizerState {
                    ScissorTestEnable = true
                };
                Rectangle textClip = new Rectangle(
                    (int)BASE_OFFSET.X, (int)BASE_OFFSET.Y,
                    Config.WINDOW_WIDTH - (int)(BASE_OFFSET.X * 2),
                    Config.WINDOW_HEIGHT - (int)(BASE_OFFSET.Y * 2));
                spriteBatch.GraphicsDevice.ScissorRectangle =
                    Scene_Map.fix_rect_to_screen(textClip);

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, scissorState);
                foreach (var text in CreditsText)
                {
                    text.draw(spriteBatch, ScrollOffset - BASE_OFFSET);
                }
                spriteBatch.End();

                if (FullCreditsButton != null)
                {
                    spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                    FullCreditsButton.Draw(spriteBatch);
                    spriteBatch.End();
                }
            }

            base.Draw(spriteBatch);
        }