The draw rect.
Inheritance: DrawObject
Example #1
0
 /// <summary>The center on rectangle horizontally.</summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="indent">The indent.</param>
 public void CenterOnRectangleHorizontally(DrawRect rectangle, float indent = 0)
 {
     this.Position = new Vector2(
         rectangle.Position.X + indent,
         rectangle.Position.Y + rectangle.Size.Y / 2 - this.Size.Y / 2);
 }
Example #2
0
        /// <summary>
        ///     Initializes static members of the <see cref="Menu" /> class.
        /// </summary>
        static Menu()
        {
            if (MenuVariables.DragAndDropDictionary == null)
            {
                MenuVariables.DragAndDropDictionary = new Dictionary<string, DragAndDrop>();
            }

            MenuPanel = new DrawRect(Color.Black);
            PanelText = new DrawText { Text = "EnsageSharp Menu", FontFlags = FontFlags.AntiAlias };
            TextureDictionary = new Dictionary<string, DotaTexture>();
            ItemDictionary = new Dictionary<string, MenuItem>();
            Drawing.OnDraw += OnDraw;
            ActivateCommonMenu();
        }
Example #3
0
 /// <summary>The center on rectangle.</summary>
 /// <param name="rectangle">The rectangle.</param>
 public void CenterOnRectangle(DrawRect rectangle)
 {
     this.Position = new Vector2(
         rectangle.Position.X + rectangle.Size.X / 2 - this.Size.X / 2,
         rectangle.Position.Y + rectangle.Size.Y / 2 - this.Size.Y / 2);
 }
Example #4
0
 /// <summary>The center on rectangle vertically.</summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="indent">The indent.</param>
 public void CenterOnRectangleVertically(DrawRect rectangle, float indent = 0)
 {
     this.Position = new Vector2(
         rectangle.Position.X + rectangle.Size.X / 2 - this.Size.X / 2, 
         rectangle.Position.Y + indent);
 }
Example #5
0
 /// <summary>The center on rectangle horizontally.</summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="indent">The indent.</param>
 public void CenterOnRectangleHorizontally(DrawRect rectangle, float indent = 0)
 {
     this.Position = new Vector2(
         rectangle.Position.X + indent, 
         rectangle.Position.Y + rectangle.Size.Y / 2 - this.Size.Y / 2);
 }
Example #6
0
 /// <summary>The center on rectangle.</summary>
 /// <param name="rectangle">The rectangle.</param>
 public void CenterOnRectangle(DrawRect rectangle)
 {
     this.Position = new Vector2(
         rectangle.Position.X + rectangle.Size.X / 2 - this.Size.X / 2, 
         rectangle.Position.Y + rectangle.Size.Y / 2 - this.Size.Y / 2);
 }
Example #7
0
 /// <summary>The center on rectangle vertically.</summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="indent">The indent.</param>
 public void CenterOnRectangleVertically(DrawRect rectangle, float indent = 0)
 {
     this.Position = new Vector2(
         rectangle.Position.X + rectangle.Size.X / 2 - this.Size.X / 2,
         rectangle.Position.Y + indent);
 }