/Scenes/UserInterfaces/Controls/Label.cs
C# | 907 lines | 455 code | 98 blank | 354 comment | 25 complexity | ca64271f95c50e3fc365232addecd217 MD5 | raw file
Possible License(s): Apache-2.0
- using System;
- using System.ComponentModel;
- using System.IO;
- using Delta.Engine;
- using Delta.Engine.SettingsNodes;
- using Delta.InputSystem;
- using Delta.Rendering.Basics.Drawing;
- using Delta.Rendering.Basics.Fonts;
- using Delta.Scenes.Enums;
- using Delta.Scenes.UserInterfaces.Designs;
- using Delta.Utilities;
- using Delta.Utilities.Datatypes;
- using Delta.Utilities.Datatypes.Advanced;
- using Delta.Utilities.Helpers;
- using NUnit.Framework;
- using Delta.ContentSystem.Xml;
-
- namespace Delta.Scenes.UserInterfaces.Controls
- {
- /// <summary>
- /// This is a simple label control for displaying (read-only) text on a
- /// screen.
- /// </summary>
- public class Label : BaseControl
- {
- #region Constants
- /// <summary>
- /// The current version of the implementation of this control class.
- /// </summary>
- private const int VersionNumber = 1;
-
- private const string TextElementName = "Label.TextContent";
- #endregion
-
- #region Delegates
- /// <summary>
- /// The delegate declaration for the text changed event.
- /// </summary>
- /// <param name="sender">Sender</param>
- public delegate void TextChangedEvent(Label sender);
- #endregion
-
- #region Text (Public)
- /// <summary>
- /// Text to display on this label.
- /// </summary>
- private string text;
- /// <summary>
- /// The displayed text, will be localized automatically (make sure you have
- /// an entry for this in your Localization.xml content file).
- /// </summary>
- [Browsable(true)]
- public string Text
- {
- get
- {
- return text;
- }
- set
- {
- // Note: If Localization.WarnIfLanguageKeyWasNotFound is on this might
- // produce warnings for text entries not found as language keys.
- text =
- String.IsNullOrEmpty(value)
- ? value
- : Localization.Get(value);
- }
- }
- #endregion
-
- #region TextContentElement (Public)
- /// <summary>
- /// The content element which
- /// </summary>
- /// <returns>Dockable element</returns>
- public AlignableElement TextContentElement
- {
- get;
- set;
- }
- #endregion
-
- #region IsTextElementAutoSizing
- /// <summary>
- /// Indicates if the TextContentElement applies the same size as the Label
- /// every time the size of this Label changes
- /// <para />
- /// Note: Default is 'true'.
- /// </summary>
- public bool IsTextElementAutoSizing
- {
- get;
- set;
- }
- #endregion
-
- #region TextDrawArea (Public)
- /// <summary>
- /// Text draw area
- /// </summary>
- public Rectangle TextDrawArea
- {
- get
- {
- return TextContentElement.DrawArea;
- } // get
- }
- #endregion
-
- #region Protected
-
- #region FallbackDesign (Protected)
- /// <summary>
- /// Defines the theme which will be used if no "Theme" was set explicitely.
- /// </summary>
- protected override ControlDesign FallbackDesign
- {
- get
- {
- return Theme.Current.LabelDesign;
- } // get
- }
- #endregion
-
- #region TextFont (Protected)
- /// <summary>
- /// The font which is used to displaying the text.
- /// </summary>
- /// <remarks>
- /// This value get updated everytime the design of the Label changes.
- /// </remarks>
- /// <returns>Font</returns>
- protected Font TextFont
- {
- get
- {
- // If we want to use the font right now but there is no valid one yet
- // then we just use the Engine fallback font
- return (labelDesign != null)
- ? labelDesign.TextFont
- : Font.Default;
- } // get
- }
- #endregion
-
- #endregion
-
- #region Private
-
- #region lastText (Private)
- /// <summary>
- /// The last set text of this element which is used to "detect" text
- /// changes of the element by the user.
- /// </summary>
- private string lastText;
- #endregion
-
- #region labelDesign (Private)
- /// <summary>
- /// Label design
- /// </summary>
- private ITextDesign labelDesign;
- #endregion
-
- #endregion
-
- #region Constructors
- /// <summary>
- /// Create label
- /// </summary>
- public Label()
- {
- TextContentElement = new AlignableElement
- {
- Name = TextElementName,
- };
- Add(TextContentElement);
-
- IsTextElementAutoSizing = true;
- }
- #endregion
-
- #region TextChanged (Event)
- /// <summary>
- /// Occurs every time the text of the label will be changed.
- /// </summary>
- public event TextChangedEvent TextChanged;
- #endregion
-
- #region Save (Public)
- /// <summary>
- /// Saves all data which are necessary to restore the object again.
- /// </summary>
- /// <param name="dataWriter">
- /// The writer which contains the stream where the data should be saved
- /// into now.
- /// </param>
- public override void Save(BinaryWriter dataWriter)
- {
- // At first we write the data of the base class
- base.Save(dataWriter);
-
- // and then save the version of the current data format
- dataWriter.Write(VersionNumber);
-
- // before we can finally save the properties
- Text.Save(dataWriter);
- }
- #endregion
-
- #region Load (Public)
- /// <summary>
- /// Loads and restores all previously saved values that belongs to this
- /// class only from the given data reader.
- /// </summary>
- /// <param name="dataReader">
- /// The reader which contains the stream with the saved data which needs to
- /// be loaded now.
- /// </param>
- public override void Load(BinaryReader dataReader)
- {
- // We have to remove the automatically created text area element because
- // we will load (and create) it by the saved data, but still remember it
- // to have the chance to restore it again in the case we will get an
- // error while loading
- AlignableElement orgTextAreaElement = TextContentElement;
- Remove(TextContentElement);
- TextContentElement = null;
-
- // At first we need to load all data of the base class
- base.Load(dataReader);
-
- // and then check which version of the data need to load now
- int version = dataReader.ReadInt32();
- switch (version)
- {
- // Version 1
- case VersionNumber:
- Text = dataReader.ReadString();
-
- // Look for the text area element we have to re-reference
- foreach (AlignableElement child in Children)
- {
- if (child.Name == TextElementName)
- {
- // we have found it, so reference it
- TextContentElement = child;
- // and finally dispose the old element
- orgTextAreaElement.Dispose();
- break;
- } // if
- } // foreach
-
- // If something went wrong
- if (TextContentElement == null)
- {
- // notify the user
- Log.Warning("The text area element couldn't be loaded.");
- // and restore the old element
- TextContentElement = orgTextAreaElement;
- Add(TextContentElement);
- } // if
- break;
-
- default:
- Log.InvalidVersionWarning(GetType().Name, version, VersionNumber);
- break;
- } // switch
- }
- #endregion
-
- #region Methods (Private)
-
- #region OnSizeChanging
- /// <summary>
- /// On size changing
- /// </summary>
- /// <param name="oldSize">Old size</param>
- /// <returns>
- /// 'True' if the new value can be used or 'false' if the change should be
- /// aborted.
- /// </returns>
- protected override bool OnSizeChanging(Size oldSize)
- {
- if (base.OnSizeChanging(oldSize))
- {
- if (IsTextElementAutoSizing)
- {
- TextContentElement.Size = Size;
- } // if
-
- return true;
- } // if
-
- return false;
- }
- #endregion
-
- #region OnDesignChanging
- /// <summary>
- /// On design changed
- /// </summary>
- /// <param name="oldDesign">Old design</param>
- /// <returns>
- /// 'True' if the new value can be used or 'false' if the change should be
- /// aborted.
- /// </returns>
- protected override bool OnDesignChanging(ControlDesign oldDesign)
- {
- if (base.OnDesignChanging(oldDesign))
- {
- // Check if the new design is a valid 'TextControlDesign' but
- // Note: Even 'null' will be accepted and handled here
- labelDesign = Design as ITextDesign;
- if (labelDesign == null)
- {
- Log.Warning(
- "The new design '" + Design + "' which will be set to the " +
- "control '" + this + "' is no kind of a '" +
- typeof(ITextDesign).Name +"' design which means that the text " +
- "won't be displayed correctly.");
- } // if
-
- return true;
- } // if
-
- return false;
- }
- #endregion
-
- #region OnTextChanging
- /// <summary>
- /// On text changing
- /// </summary>
- /// <param name="oldText">Old text</param>
- /// <returns>
- /// 'True' if the new value can be used or 'false' if the change should be
- /// aborted.
- /// </returns>
- protected virtual bool OnTextChanging(string oldText)
- {
- // Always accept the text change but determine if this "auto fallback"
- // decides it or we have an listener who can make a "real" decision
- return true;
- }
- #endregion
-
- #region DetectChanges
- /// <summary>
- /// This method implements the checks of the changes which are should be
- /// detected in this element. It also cares about triggering the events and
- /// the event handler methods.
- /// </summary>
- protected override void DetectChanges()
- {
- base.DetectChanges();
-
- if (Text != lastText)
- {
- // Check now if the new value should be set
- if (OnTextChanging(lastText))
- {
- lastText = Text;
-
- // After setting the new value also inform all external listeners
- // about the change
- if (TextChanged != null &&
- // but only if it isn't just the value initialization
- isRuntimeValueChange)
- {
- TextChanged.Invoke(this);
- } // if
- } // if
- else
- {
- // if the change is not ok, then just reset to old value again
- Text = lastText;
- } // else
- } // if
- }
- #endregion
-
- #region DrawData
- /// <summary>
- /// Draws all data of this Label which needs to be visualized.
- /// </summary>
- /// <remarks>
- /// This method will only be called if the Label is in a visible state.
- /// </remarks>
- protected override void DrawData()
- {
- base.DrawData();
-
- string displayText = GetDisplayText();
-
- if (String.IsNullOrEmpty(displayText))
- {
- // It only make sense to call 'Font.Draw()' if we really have a text
- return;
- } // if
-
- // Always draw the text even if the control is disabled
- // Note: If the control is invisible, the draw won't be called anyway
- Font textFont =
- State == ElementState.Disabled
- ? labelDesign.DisabledTextFont
- : labelDesign.TextFont;
-
- // but only draw text if there is a valid font set
- if (textFont != null)
- {
- textFont.Draw(displayText, TextContentElement.DrawArea, Rotation,
- Point.Zero);
- } // if
- }
- #endregion
-
- #region GetDisplayText
- /// <summary>
- /// Get display text
- /// </summary>
- protected virtual string GetDisplayText()
- {
- return Text;
- }
- #endregion
-
- #region DrawDebugInfo
- /// <summary>
- /// Draw debug info
- /// </summary>
- protected override void DrawDebugInfo()
- {
- base.DrawDebugInfo();
-
- // Only really detailed visual information about this element if the UI
- // profiling mode is enabled additional to the UI debug mode
- if (Settings.Debug.IsProfilingModeOn(ProfilingMode.UI))
- {
- Rect.DrawFilled(DrawArea, Color.Green);
- } // if
-
- // otherwise just use the simple version
- else
- {
- Rect.DrawOutline(DrawArea, Color.Green, Rotation);
- } // else
- }
- #endregion
-
- #region ShortElementInfo
- /// <summary>
- /// Short control info
- /// </summary>
- protected override string ShortElementInfo()
- {
- return base.ShortElementInfo() + ", Text=" + Text;
- }
- #endregion
-
- #endregion
-
- /// <summary>
- /// Tests for Label controls
- /// </summary>
- [NUnit.Framework.Category("Visual")]
- internal class LabelTests
- {
- #region Helpers
-
- #region TestLabelDesign
- /// <summary>
- /// Test label design
- /// </summary>
- private static readonly TextControlDesign TestLabelDesign =
- new TextControlDesign
- {
- Background = null,
- DisabledBackground = null,
- Hover = null,
- TextFont = new Font(Font.Default, Color.Gold),
- DisabledTextFont = new Font(Font.Default, Color.Black),
- TextBackground = BaseTheme.GetUIMaterial("DefaultLabel"),
- TextHoverBackground = BaseTheme.GetUIMaterial("DefaultLabel",
- Color.Yellow),
- DisabledTextBackground = BaseTheme.GetUIMaterial("DefaultLabel",
- Color.Grey),
- };
- #endregion
-
- #endregion
-
- #region Clone (Static)
- /// <summary>
- /// Clone
- /// </summary>
- [Test]
- public static void Clone()
- {
- using (Label testLabel = new Label
- {
- Name = "testButton",
- Text = "testing",
- })
- {
- Label clonedLabel = testLabel.Clone<Label>();
- Assert.NotEqual(testLabel, clonedLabel);
- Assert.NotEqual(testLabel.Children, clonedLabel.Children);
- Assert.Equal(testLabel.Name, clonedLabel.Name);
- Assert.Equal(testLabel.Text, clonedLabel.Text);
- } // using
- }
- #endregion
-
- #region DisplayLabel (Static)
- /// <summary>
- /// Display label
- /// </summary>
- [Test]
- public static void DisplayLabel()
- {
- const string LabelInitText = "Text";
- Label testLabel = new Label
- {
- LocalArea = Rectangle.FromCenter(0.35f, 0.35f, 0.4f, 0.125f),
- Text = LabelInitText,
- //Design = TestLabelDesign,
- };
-
- Screen testScene = new Screen();
- testScene.Add(testLabel);
-
- // Open now the scene to "activate" for the test
- testScene.Open();
-
- Application.Start(delegate
- {
- testLabel.Text =
- Input.Keyboard.SpaceIsPressed
- ? "loooooooooooooooooooooong Text"
- : LabelInitText;
-
- Point pos = new Point(0.5f, ScreenSpace.DrawArea.Top + 0.01f);
- const float LineGap = 0.02f;
- Font.Default.Draw("MousePos='" + Input.Mouse.Position + "'",
- Rectangle.FromCenter(pos, Size.Half));
- pos.Y += LineGap;
- Font.Default.Draw(
- "TextArea='" + testLabel.TextContentElement.DrawArea + "'",
- Rectangle.FromCenter(pos, Size.Half));
- pos.Y += LineGap;
- });
- }
- #endregion
-
- #region DisabledLabel (Static)
- /// <summary>
- /// Disabled label
- /// </summary>
- [Test]
- public static void DisabledLabel()
- {
- Label testLabel = new Label
- {
- LocalArea = new Rectangle(0.25f, 0.25f, 0.5f, 0.15f),
- //Design = TestLabelDesign,
- Text = "Enabled",
- };
-
- Screen testScene = new Screen();
- testScene.Add(testLabel);
-
- // Open now the scene to "activate" for the test
- testScene.Open();
-
- Application.Start(delegate
- {
- // Start the visual test to see the Label
- // Disable/enable the Label by pressing the keyboard "Space" button
- if (Input.Keyboard.SpaceReleased)
- {
- if (testLabel.State >= ElementState.Enabled)
- {
- testLabel.State = ElementState.Disabled;
- }
- else
- {
- testLabel.State =
- testLabel.IsInControl(Input.Mouse.Position)
- ? ElementState.Hovered
- : ElementState.Enabled;
- } // else
- testLabel.Text = testLabel.State.ToString();
- }
- });
- }
- #endregion
-
- #region TextAlignment (Static)
- /// <summary>
- /// Text alignment
- /// </summary>
- [Test]
- public static void TextAlignment()
- {
- // The used UI scene for the unit test
- Screen testScene = new Screen();
-
- Label testLabel = new Label
- {
- LocalArea = new Rectangle(0.15f, 0.3f, 0.4f, 0.15f),
- CustomDesign = TestLabelDesign,
- Text = "Please press 'Space'",
- };
- testScene.Add(testLabel);
- //testImage.Text = "Alignment=" + testImage.Alignment;
-
- // Open now the scene to "activate" for the test
- testScene.Open();
-
- Application.Start(delegate
- {
- // Cycling through all alignment modes by pressing the "Space" key
- if (Input.Keyboard.SpaceReleased)
- {
- ITextDesign textDesign = (ITextDesign)testLabel.CustomDesign;
- textDesign.TextFont = new Font(textDesign.TextFont,
- textDesign.TextFont.HorizontalAlignment.NextValue());
- testLabel.Text = textDesign.TextFont.HorizontalAlignment + " text";
- }
- });
- }
- #endregion
-
- #region DisplayMultilineText (Static)
- /// <summary>
- /// Display multiline text
- /// </summary>
- [Test]
- public static void DisplayMultilineText()
- {
- Screen testScene = new Screen();
-
- Label singleLineLabel = new Label
- {
- LocalArea = Rectangle.FromCenter(0.25f, 0.5f, 0.3f, 0.2f),
- Text = "Single line text",
- CustomDesign = TestLabelDesign,
- };
- testScene.Add(singleLineLabel);
-
- Label multiLineLabel = new Label
- {
- LocalArea = Rectangle.FromCenter(0.75f, 0.5f, 0.3f, 0.2f),
- Text = "Multi-\r\n" + "Line-\n" + "Text",
- CustomDesign = TestLabelDesign,
- };
- testScene.Add(multiLineLabel);
-
- // Open now the scene to "activate" for the test
- testScene.Open();
-
- Application.Start(delegate
- {
- // Cycling through all alignment modes by pressing the "Space" key
- if (Input.Keyboard.SpaceReleased)
- {
- // Grab the fonts
- ITextDesign singleTextDesign =
- singleLineLabel.CustomDesign as ITextDesign;
- ITextDesign multiTextDesign =
- multiLineLabel.CustomDesign as ITextDesign;
-
- // determine the next text alignment mode
- HorizontalAlignment newTextAlignment =
- singleTextDesign.TextFont.HorizontalAlignment.NextValue();
-
- // and set it
- singleTextDesign.TextFont =
- new Font(singleTextDesign.TextFont, newTextAlignment);
- multiTextDesign.TextFont =
- new Font(multiTextDesign.TextFont, newTextAlignment);
- }
- });
- }
- #endregion
-
- #region Docking (Static)
- /// <summary>
- /// Docking
- /// </summary>
- [Test]
- public static void Docking()
- {
- // // The used UI screen for the unit test
- // UserScreen testScene = new UserScreen();
-
- // Label testLabel = new Label
- // {
- // LocalArea = new Rectangle(0.15f, 0.3f, 0.4f, 0.15f),
- // Design = TestLabelDesign,
- // Size = new Size(0.1f, 0.02f),
- // //Docking
- // AnchorPoint = AnchorType.Middle,
- // };
- // testScene.Add(testLabel);
- // //testImage.Text = "Alignment=" + testImage.Alignment;
-
- // // Open now the scene to "activate" for the test
- // testScene.Open();
-
- // Application.Start(delegate
- // {
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.SpaceReleased)
- // {
- // testLabel.Alignment = EnumHelper.NextValue(testLabel.Alignment);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // //testImage.Text = "Alignment=" + testImage.Alignment
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint;
- // ;
- // }
-
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.EnterReleased)
- // {
- // testLabel.AnchorPoint =
- // EnumHelper.NextValue(testLabel.AnchorPoint);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint;
- // }
-
- // // By pressing the "Ctrl" key we change the scaling of the control to
- // // if the alignment still works
- // testLabel.Scaling = Input.Keyboard.IsPressed(InputButton.LeftControl) ?
- // 0.5f : 1.0f;
- // });
- }
- #endregion
-
- #region Alignment (Static)
- /// <summary>
- /// Alignment
- /// </summary>
- [Test]
- public static void Alignment()
- {
- // // The used UI scene for the unit test
- // UIScene testScene = new UIScene();
-
- // Label testLabel = new Label
- // {
- // LocalArea = new Rectangle(0.15f, 0.3f, 0.4f, 0.15f),
- // Design = TestLabelDesign,
- // //Scaling = 0.5f,
- // Size = new Size(0.1f, 0.02f),
- // AnchorPoint = AnchorType.Middle,
- // };
- // testScene.Add(testLabel);
- // //testImage.Text = "Alignment=" + testImage.Alignment;
-
- // // Open now the scene to "activate" for the test
- // testScene.Open();
-
- // Application.Start(delegate
- // {
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.SpaceReleased)
- // {
- // testLabel.Alignment = EnumHelper.NextValue(testLabel.Alignment);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // //testImage.Text = "Alignment=" + testImage.Alignment
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint; ;
- // }
-
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.EnterReleased)
- // {
- // testLabel.AnchorPoint =
- // EnumHelper.NextValue(testLabel.AnchorPoint);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint;
- // }
-
- // // By pressing the "Ctrl" key we change the scaling of the control to
- // // if the alignment still works
- // testLabel.Scaling = Input.Keyboard.IsPressed(InputButton.LeftControl) ?
- // 0.5f : 1.0f;
- // });
- }
- #endregion
-
- #region ChildAlignment (Static)
- /// <summary>
- /// Child alignment
- /// </summary>
- [Test]
- public static void ChildAlignment()
- {
- // // The used UI scene for the unit test
- // UIScene testScene = new UIScene();
-
- // Label parentLabel = new Label
- // {
- // LocalArea = new Rectangle(0.2f, 0.2f, 0.6f, 0.5f),
- // Design = TestLabelDesign,
- // //Scaling = 0.5f,
- // //Text = "No AutoSize", -> no text because of child control text
- // };
-
- // Label testLabel = new Label
- // {
- // //LocalArea = new Rectangle(0.15f, 0.3f, 0.4f, 0.15f),
- // LocalPosition = new Point(0.15f, 0.3f),
- // Size = new Size(0.1f, 0.02f),
- // AnchorPoint = AnchorType.TopRight,
- // Design = TestLabelDesign,
- // //Scaling = 0.5f,
-
- // };
- // parentLabel.Add(testLabel);
- // testScene.Add(parentLabel);
- // //testImage.Text = "Alignment=" + testImage.Alignment;
-
- // // Open now the scene to "activate" for the test
- // testScene.Open();
-
- // Application.Start(delegate
- // {
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.SpaceReleased)
- // {
- // testLabel.Alignment = EnumHelper.NextValue(testLabel.Alignment);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // //testImage.Text = "Alignment=" + testImage.Alignment
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint; ;
- // }
-
- // // Cycling through all alignment modes by pressing the "Space" key
- // if (Input.Keyboard.EnterReleased)
- // {
- // testLabel.AnchorPoint =
- // EnumHelper.NextValue(testLabel.AnchorPoint);
- // //testLabel.Text = testLabel.Alignment.ToString();
- // testLabel.Text = "Alignment=" + testLabel.Alignment +
- // ", AnchorPoint= " + testLabel.AnchorPoint;
- // }
-
- // // By pressing the "Ctrl" key we change the scaling of the control to
- // // if the alignment still works
- // testLabel.Scaling = Input.Keyboard.IsPressed(InputButton.LeftControl) ?
- // 0.5f : 1.0f;
- // });
- }
- #endregion
-
- #region DrawLabelDepthTest (Static)
- /// <summary>
- /// Draw Label Depth Test
- /// </summary>
- [Test]
- public static void DrawLabelDepthTest()
- {
- // // The used UI scene for the unit test
- // UIScene uiScene = Base.GameScreen.OverlayScreen.UIScene;
-
- // Label frontLabel = null;
- // Label backLabel = null;
-
- // Base.StartTest("Display Label", delegate
- // {
- // if (frontLabel == null)
- // {
- // frontLabel = new Label
- // {
- // LocalArea = new Rectangle(0.3f, 0.46f, 0.4f, 0.08f),
- // IsAutoSizing = false,
- // Text = "I AM IN FRONT!!! :D",
- // TextColor = Color.Red,
- // TextFont = Graphic.InfoFont,//new Font("Arial", 13),
- // DepthLayer = 2,
- // };
- // uiScene.Add(frontLabel);
-
- // backLabel = new Label
- // {
- // LocalArea = new Rectangle(0.27f, 0.415f, 0.4f, 0.08f),
- // IsAutoSizing = false,
- // Text = "I AM IN THE BACK :(",
- // TextColor = Color.Red,
- // TextFont = Graphic.InfoFont,//new Font("Arial", 13),
- // DepthLayer = 8,
- // };
- // uiScene.Add(backLabel);
-
- // }
- // });
- }
- #endregion
- }
- }
- }