added clipping rectangles to gui controls so that text is clipped inside the bounds of textbox

This commit is contained in:
Dylan Wilson
2017-02-22 21:19:04 +10:00
parent 3be8189376
commit 8fa15aedf6
8 changed files with 60 additions and 38 deletions
+1 -4
View File
@@ -53,7 +53,7 @@ namespace MonoGame.Extended.Gui
var cursor = Screen.Skin?.Cursor;
if (cursor != null)
_renderer.DrawRegion(cursor.TextureRegion, CursorPosition, cursor.Color);
_renderer.DrawRegion(cursor.TextureRegion, CursorPosition, cursor.Color, null);
}
_renderer.End();
@@ -62,10 +62,7 @@ namespace MonoGame.Extended.Gui
private void DrawChildren(GuiControlCollection controls, float deltaSeconds)
{
foreach (var control in controls.Where(c => c.IsVisible))
{
//_renderer.DrawRegion(null, control.BoundingRectangle.ToRectangle(), Color.Magenta);
control.Draw(_renderer, deltaSeconds);
}
foreach (var childControl in controls.Where(c => c.IsVisible))
DrawChildren(childControl.Controls, deltaSeconds);