Exemple #1
0
 public void FadeTo(Fx32 level, int ticks)
 {
     targetLevel = level;
     if (ticks == 0)
     {
         currLevel = targetLevel;
         running = false;
     }
     else
     {
         speed = ((currLevel - targetLevel) / ticks).Abs();
         running = true;
     }
 }
Exemple #2
0
 void Tick()
 {
     if (!running) return;
     currLevel = Lib.MoveValueTowards(currLevel, targetLevel, speed);
     if (currLevel == targetLevel) running = false;
 }
 public void SetMasterBrightness(Fx32 level)
 {
     effect.Parameters["master_brightness"].SetValue(level.toFloat());
     game.currTechnique.MakeDirty();
 }
Exemple #4
0
 public void TranslateLocal(Fx32 x, Fx32 y)
 {
     TranslateLocal(x, y, 0); IsDirty = true;
 }
Exemple #5
0
 public void TranslateLocal(Fx32 x, Fx32 y, Fx32 z)
 {
     TranslateLocal(x.toFloat(), y.toFloat(), z.toFloat()); IsDirty = true;
 }
Exemple #6
0
		public void Set(FxVector3 other) { x = other.x; y = other.y; z = other.z; }
Exemple #7
0
 public void ScaleLocal(Fx32 ratio)
 {
     float temp = ratio.toFloat(); ScaleLocal(temp, temp, temp); IsDirty = true;
 }
Exemple #8
0
		public void Set(Fx32 x, Fx32 y) { this.x = x; this.y = y; this.z = 0; }
Exemple #9
0
		public FxVector3(Fx32 x, Fx32 y, Fx32 z) { this.x = x; this.y = y; this.z = z; }
Exemple #10
0
		public FxVector3(Fx32 x, Fx32 y) { this.x = x; this.y = y; this.z = 0; }
Exemple #11
0
		public Fx32 Interpolate(Fx32 param, Fx32 target)
		{
			Fx32 diff = target - this;
			return this + diff * param;
		}
Exemple #12
0
		public static Fx32 Min(Fx32 a, Fx32 b) { return a < b ? a : b; }
Exemple #13
0
		public static Fx32 Max(Fx32 a, Fx32 b) { return a > b ? a : b; }
Exemple #14
0
		public FxVector3 Interpolate(Fx32 param, FxVector3 target)
		{
			FxVector3 diff = target - this;
			return this + diff * param;
		}