/// <summary> /// Used to smoothly change the value of the ProgressBar. /// </summary> /// <param name="newValue">Value to set.</param> /// /// <param name="speed">Speed of value Transition.Smooth [0.01f, 0.05f].</param> public void SetValue(uint newValue, float speed = 0.025f) { if (speed < 0.01f) { speed = 0.01f; } if (speed > 0.05f) { speed = 0.05f; } if (newValue >= 100) { newValue = 100; } if (newValue <= 000) { newValue = 000; } if (PRGCHANGE != null) { PRGCHANGE.Pause(); Value = valueToSet; } valueToSet = newValue; PRGCHANGE = new NDC.NDynamics.Core.Lerp((int)Value, newValue, speed, 0.1f, 1); PRGCHANGE.LTick += PRGCHANGE_LerpTick; PRGCHANGE.LDone += PRGCHANGE_LerpDone; PRGCHANGE.Start(); }
private void NBTN_MU(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (!Override) { LCU = new NDC.NDynamics.Core.Lerp(6, 2, 0.01f, 0.1f, 1); LCU.LTick += LCU_TICK; LCU.LDone += LCU_DONE; LCU.Start(); if (LCD != null) { LCD.Pause(); } } }
private void BOR_UNHOVER() { try { if (BRHOV != null) { BRHOV.Pause(); } BRUNH = new NDC.NDynamics.Core.Lerp(2, 0, 0.01f, 0.1f, 1); BRUNH.LTick += BRUNH_LerpTick; BRUNH.LDone += BRUNH_LerpDone; BRUNH.Start(); } catch { } }
private void BOR_HOVER() { try { if (BRUNH != null) { BRUNH.Pause(); } if (isFocused == false) { BRHOV = new NDC.NDynamics.Core.Lerp(0, 2, 0.01f, 0.1f, 1); BRHOV.LTick += BRHOV_LerpTick; BRHOV.LDone += BRHOV_LerpDone; BRHOV.Start(); } } catch { } }