API Reference › Percent › Percent.clamp
method

Percent.clamp

Percent.clamp(v) -> fixed

Pins any fixed into the range [0, 1] — a health fraction or volume that can never slip out of bounds.

Example

program Demo {
  handler Step phase Update {
    let hp = Percent.clamp(health)
  }
}
← All symbols