public void FadeTo(Fx32 level, int ticks) { targetLevel = level; if (ticks == 0) { currLevel = targetLevel; running = false; } else { speed = ((currLevel - targetLevel) / ticks).Abs(); running = true; } }
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(); }
public void TranslateLocal(Fx32 x, Fx32 y) { TranslateLocal(x, y, 0); IsDirty = true; }
public void TranslateLocal(Fx32 x, Fx32 y, Fx32 z) { TranslateLocal(x.toFloat(), y.toFloat(), z.toFloat()); IsDirty = true; }
public void Set(FxVector3 other) { x = other.x; y = other.y; z = other.z; }
public void ScaleLocal(Fx32 ratio) { float temp = ratio.toFloat(); ScaleLocal(temp, temp, temp); IsDirty = true; }
public void Set(Fx32 x, Fx32 y) { this.x = x; this.y = y; this.z = 0; }
public FxVector3(Fx32 x, Fx32 y, Fx32 z) { this.x = x; this.y = y; this.z = z; }
public FxVector3(Fx32 x, Fx32 y) { this.x = x; this.y = y; this.z = 0; }
public Fx32 Interpolate(Fx32 param, Fx32 target) { Fx32 diff = target - this; return this + diff * param; }
public static Fx32 Min(Fx32 a, Fx32 b) { return a < b ? a : b; }
public static Fx32 Max(Fx32 a, Fx32 b) { return a > b ? a : b; }
public FxVector3 Interpolate(Fx32 param, FxVector3 target) { FxVector3 diff = target - this; return this + diff * param; }