Print() public method

Draws the string on the console at the specified location, wrapping if needed.
public Print ( int x, int y, ColoredString text ) : void
x int X location of the text.
y int Y location of the text.
text ColoredString The string to display.
return void
 public override void Draw(ITextSurface surface, Rectangle area)
 {
     string value = ((FileLoaders.IFileLoader)Item).FileTypeName;
     if (value.Length < area.Width)
         value += new string(' ', area.Width - value.Length);
     else if (value.Length > area.Width)
         value = value.Substring(0, area.Width);
     var editor = new SurfaceEditor(surface);
     editor.Print(area.Left, area.Top, value, _currentAppearance);
     _isDirty = false;
 }
        public override void Draw(ITextSurface surface, Rectangle area)
        {
            string value = ((Editors.EntityEditor.FrameWrapper)Item).CurrentIndex.ToString();
            if (value.Length < area.Width)
                value += new string(' ', area.Width - value.Length);
            else if (value.Length > area.Width)
                value = value.Substring(0, area.Width);

            var editor = new SurfaceEditor(surface);
            editor.Print(area.X, area.Y, value, _currentAppearance);
            _isDirty = false;
        }
            public override void Draw(ITextSurface surface, Microsoft.Xna.Framework.Rectangle area)
            {
                string value = ((ResizableObject)Item).Name;

                if (string.IsNullOrEmpty(value))
                    value = "<no name>";

                if (value.Length < area.Width)
                    value += new string(' ', area.Width - value.Length);
                else if (value.Length > area.Width)
                    value = value.Substring(0, area.Width);
                var editor = new SurfaceEditor(surface);
                editor.Print(area.X, area.Y, value, _currentAppearance);
                _isDirty = false;
            }
示例#4
0
            public override void Draw(ITextSurface surface, Microsoft.Xna.Framework.Rectangle area)
            {
                string value = ((LayerMetadata)((LayeredTextSurface.Layer)Item).Metadata).Name;

                if (value.Length < area.Width)
                    value += new string(' ', area.Width - value.Length);
                else if (value.Length > area.Width)
                    value = value.Substring(0, area.Width);
                var editor = new SurfaceEditor(surface);
                editor.Print(area.X, area.Y, value, _currentAppearance);
                _isDirty = false;
            }
            /// <summary>
            /// 
            /// </summary>
            /// <param name="surface"></param>
            /// <param name="area"></param>
            public override void Draw(ITextSurface surface, Microsoft.Xna.Framework.Rectangle area)
            {
                var hotSpot = ((Hotspot)Item);
                ColoredString value = ((char)hotSpot.DebugAppearance.GlyphIndex).ToString().CreateColored(hotSpot.DebugAppearance.Foreground, hotSpot.DebugAppearance.Background, hotSpot.DebugAppearance.SpriteEffect) + " ".CreateColored(_currentAppearance.Foreground, _currentAppearance.Background) + hotSpot.Title.CreateColored(_currentAppearance.Foreground, _currentAppearance.Background);

                if (value.Count < area.Width)
                    value += new string(' ', area.Width - value.Count).CreateColored(_currentAppearance.Foreground, _currentAppearance.Background);
                else if (value.Count > area.Width)
                    value = new ColoredString(value.Take(area.Width).ToArray());
                var editor = new SurfaceEditor(surface);
                editor.Print(area.X, area.Y, value);
                _isDirty = false;
            }