The quad ease in out.
Inheritance: Transition
Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DragAndDrop" /> class.
        /// </summary>
        /// <param name="height">
        ///     The height.
        /// </param>
        /// <param name="itemList">
        ///     The item list.
        /// </param>
        /// <param name="abilityToggler">
        ///     The ability toggler.
        /// </param>
        public DragAndDrop(float height, List<string> itemList, AbilityToggler abilityToggler)
        {
            this.Height = height;
            var count = 0u;
            this.PriorityIconsDictionary = new Dictionary<PriorityIcon, uint>();
            this.itemList = new List<string>(itemList);
            foreach (var s in itemList)
            {
                this.PriorityIconsDictionary.Add(new PriorityIcon(s, height, abilityToggler.IsEnabled(s)), count);
                count++;
            }

            this.doubleClickSleeper = new Sleeper();
            this.iconCountSleeper = new Sleeper();
            this.iconSizeSleeper = new Sleeper();
            this.transition = new QuadEaseInOut(0.35);
            this.transition.Start(0, 150);
            this.abilityToggler = abilityToggler;
            this.usingAbilityToggler = true;
            this.Width = itemList.Count * this.Height;
        }