fixed some bugs in gui text box

This commit is contained in:
Dylan Wilson
2017-05-23 20:42:09 +10:00
parent b9e02362be
commit 4eae631af2
3 changed files with 8 additions and 3 deletions
@@ -80,11 +80,17 @@ namespace MonoGame.Extended.Gui.Controls
if (SelectionStart < Text.Length)
SelectionStart++;
break;
case Keys.Home:
SelectionStart = 0;
break;
case Keys.End:
SelectionStart = Text.Length;
break;
default:
if (args.Character != null)
{
Text = Text.Insert(SelectionStart, args.Character.ToString());
SelectionStart++;
Text += args.Character;
}
break;
}
@@ -3,7 +3,6 @@ using System.IO;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Gui.Controls;
using MonoGame.Extended.Gui.Serialization;
using Newtonsoft.Json;
+1 -1
View File
@@ -52,7 +52,7 @@ namespace Sandbox
{
Controls =
{
//new GuiLabel { Text = "Hello World" }
new GuiTextBox { Text = "Hello World" }
}
}
};