protected virtual void draw_units(SpriteBatch spriteBatch) { Vector2 offset = this.loc + draw_vector(); // Map sprite (first one, if not scrolling) spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); if (Scroll < UnitNodes.Count() && Offset.Y == Scroll * this.RowSize) { int scroll = Scroll * this.Columns; UnitNodes.Draw(spriteBatch, Enumerable.Range(scroll, Math.Min(UnitNodes.Count - scroll, this.Columns)), Offset - offset); } spriteBatch.End(); // Draw other units spriteBatch.GraphicsDevice.ScissorRectangle = Scene_Map.fix_rect_to_screen(Unit_Scissor_Rect); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State); var visible_range = visible_indexes_range(); if (visible_range.IsValid()) { UnitNodes.Draw(spriteBatch, visible_range.Enumerate(), Offset - offset); } spriteBatch.End(); }
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(); }