コード例 #1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="OnOffCircleSlider" /> 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 OnOffCircleSlider(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.colorChange = new QuadEaseInOut(0.35);
 }
コード例 #2
0
ファイル: Menu.cs プロジェクト: EnsageSharp/Ensage.Common
        /// <summary>
        ///     Initializes a new instance of the <see cref="Menu" /> class.
        /// </summary>
        /// <param name="displayName">
        ///     The display name.
        /// </param>
        /// <param name="name">
        ///     The name.
        /// </param>
        /// <param name="isRootMenu">
        ///     The is root menu.
        /// </param>
        /// <param name="textureName">
        ///     The texture name.
        /// </param>
        /// <param name="showTextWithTexture">
        ///     The show text with texture.
        /// </param>
        public Menu(
            string displayName, 
            string name, 
            bool isRootMenu = false, 
            string textureName = null, 
            bool showTextWithTexture = false)
            : base(20)
        {
            this.DisplayName = displayName;
            this.Name = name;
            this.IsRootMenu = isRootMenu;
            this.Style = FontStyle.Regular;
            this.Color = Root?.SelectedTheme.MenuDefaultTextColor ?? new Color(195, 186, 173, 255);
            this.TextureName = textureName;
            this.ShowTextWithTexture = showTextWithTexture;
            this.transition = new ExpoEaseInOut(0.25);

            AppDomain.CurrentDomain.DomainUnload += delegate { this.SaveAll(); };
            AppDomain.CurrentDomain.ProcessExit += delegate { this.SaveAll(); };
            Events.OnClose += delegate { this.SaveAll(); };
        }
コード例 #3
0
 /// <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) };
 }
コード例 #4
0
ファイル: Notification.cs プロジェクト: spyware293/Ensage
        /// <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);
        }