From dc6c472b84bee7c1e51abb1108efd9100b9de04c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 30 Jan 2022 12:20:32 +0100 Subject: [PATCH] cleaned up DrawEarly documentation references --- CHANGELOG.md | 2 +- Docs/articles/ui.md | 5 +---- MLEM.Ui/Elements/Panel.cs | 2 -- MLEM.Ui/UiSystem.cs | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 390a94c..2bec1e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ Improvements - Avoid unnecessary panel updates by using an Epsilon comparison when scrolling children - Allow setting a default text alignment for paragraphs in UiStyle - Made custom values of Element.Style persist when a new ui style is set -- Use a scissor rectangle for panels in favor of a render target +- Use a scissor rectangle for panels instead of a render target Fixes - Fixed paragraph links having incorrect hover locations when using special text alignments diff --git a/Docs/articles/ui.md b/Docs/articles/ui.md index 296cffe..e39eded 100644 --- a/Docs/articles/ui.md +++ b/Docs/articles/ui.md @@ -21,10 +21,7 @@ protected override void Update(GameTime gameTime) { this.UiSystem.Update(gameTime); } -protected override void Draw(GameTime gameTime) { - // DrawEarly needs to be called before clearing your graphics context - this.UiSystem.DrawEarly(gameTime, this.SpriteBatch); - +protected override void Draw(GameTime gameTime) { this.GraphicsDevice.Clear(Color.CornflowerBlue); // Do your regular game drawing here diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 7ab165b..0554c54 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -176,8 +176,6 @@ namespace MLEM.Ui.Elements { batch.Draw(this.Texture, this.DisplayArea, this.DrawColor.OrDefault(Color.White) * alpha, this.Scale); // if we handle overflow, draw using a scissor rectangle if (this.scrollOverflow) { - this.UpdateAreaIfDirty(); - batch.End(); batch.GraphicsDevice.ScissorRectangle = (Rectangle) this.GetInnerArea(); diff --git a/MLEM.Ui/UiSystem.cs b/MLEM.Ui/UiSystem.cs index 77f9f46..5063e82 100644 --- a/MLEM.Ui/UiSystem.cs +++ b/MLEM.Ui/UiSystem.cs @@ -281,7 +281,6 @@ namespace MLEM.Ui { /// /// Draws any s onto the screen. - /// Note that, when using s with a scroll bar, needs to be called as well. /// /// The game's time /// The sprite batch to use for drawing