The draw text.
Inheritance: DrawObject
 /// <summary>
 ///     Initializes a new instance of the <see cref="PriorityIcon" /> class.
 /// </summary>
 /// <param name="name">
 ///     The name.
 /// </param>
 /// <param name="height">
 ///     The height.
 /// </param>
 /// <param name="enabled">
 ///     The enabled.
 /// </param>
 public PriorityIcon(string name, float height, bool enabled)
 {
     this.texture = name.Substring(0, "item".Length) == "item"
                        ? Textures.GetTexture(
                            "materials/ensage_ui/items/" + name.Substring("item_".Length) + ".vmat")
                        : Textures.GetTexture("materials/ensage_ui/spellicons/" + name + ".vmat");
     this.Height = height;
     this.Name = name;
     this.Item = this.Name.Contains("item");
     this.priorityNumber = new DrawText
                               {
                                   FontFlags = FontFlags.AntiAlias, Color = Color.White, 
                                   Position = this.Position + new Vector2(4, 3)
                               };
     this.transition = new QuadEaseInOut(0.35);
     this.Hover = new QuadEaseInOut(0.35);
     this.Hover.Start(0, 40);
     this.Enabled = enabled;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="OnOffSlider" /> class.
 /// </summary>
 /// <param name="onColor">
 ///     The on color.
 /// </param>
 /// <param name="offColor">
 ///     The off color.
 /// </param>
 /// <param name="height">
 ///     The height.
 /// </param>
 /// <param name="enabled">
 ///     The enabled.
 /// </param>
 public OnOffSlider(Color onColor, Color offColor, float height, bool enabled)
 {
     this.onColor = onColor;
     this.offColor = offColor;
     this.Height = height;
     this.transition = new CubicEaseInOut(0.30);
     this.hover = new QuadEaseInOut(0.20);
     this.leftButtonSleeper = new Sleeper();
     this.Enabled = enabled;
     this.char1 = new DrawText { FontFlags = FontFlags.AntiAlias, Text = "°", Color = new Color(50, 50, 50) };
     this.char2 = new DrawText { FontFlags = FontFlags.AntiAlias, Text = "°", Color = new Color(180, 180, 180) };
 }
Exemple #3
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();
        }
Exemple #4
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Notification" /> class.
        /// </summary>
        /// <param name="duration">
        ///     The duration.
        /// </param>
        /// <param name="position">
        ///     The position.
        /// </param>
        /// <param name="size">
        ///     The size.
        /// </param>
        public Notification(float duration, Vector2 position, Vector2 size)
        {
            this.Duration = duration;
            this.alliesNearbySleeper = new Sleeper();
            this.Position = position;
            this.positionOn = position - new Vector2(size.X + 1, 0);
            this.positionOff = position + new Vector2(1, 0);
            this.Size = size;
            this.Visible = true;
            this.HeroIconSize = new Vector2((float)(size.X / 2.9), (float)(size.Y / 1.5));
            this.chargeText = new DrawText
                                  {
                                      Text = "DETONATE", Color = Color.White, FontFlags = FontFlags.AntiAlias,
                                      Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 2.1))
                                  };
            this.healthText = new DrawText
                                  {
                                      Text = string.Empty, Color = Color.White, FontFlags = FontFlags.AntiAlias,
                                      Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 3.1))
                                  };
            this.moveCameraText = new DrawText
                                      {
                                          Text = "MOVE CAMERA", Color = Color.White, FontFlags = FontFlags.AntiAlias,
                                          Position = new Vector2(),
                                          TextSize = new Vector2((float)(this.HeroIconSize.Y / 3.4))
                                      };

            this.keyText = new DrawText
                               {
                                   Text = string.Empty, Color = Color.White, FontFlags = FontFlags.AntiAlias,
                                   Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 2.5))
                               };
            this.transition = new QuadEaseOut(1.5);
            this.transition.Start(this.positionOn, this.positionOff);
        }
Exemple #5
0
        private void Drawing_OnDraw(EventArgs args)
        {
            if (!IsStacking || !IsValid)
            {
                return;
            }

            campNameTextPosition = HUDInfo.GetHPbarPosition(Unit)
                                   + new Vector2((GetHpBarSizeX - MeasureCampNameTextSize.X) / 2, IsHero ? 25 : 0);

            if (campNameTextPosition.IsZero)
            {
                return;
            }
            var text = CurrentCamp.Name;

            if (Debug)
            {
                text += " (" + CurrentStatus + ")";
            }

            var campName = new DrawText
            {
                Position = campNameTextPosition,
                Text = text,
                Color = Color.White,
                TextSize = new Vector2(16)
            };

            if (IsUnderCampNameText && !IsHero)
            {
                campName.Color = Color.Orange;
            }

            campName.Draw();
        }