Table of Contents

Class MathClamp

Namespace
Fantas
Assembly
Fantas.dll

Contains helper methods for doing Lerp to make it easier port games from MonoGame to Fantas Some methods imported from XNA/MonoGame MathHelper https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework/MathHelper.cs

public static class MathClamp
Inheritance
MathClamp
Inherited Members

Methods

Clamp(double, double, double)

Restricts a value to be within a specified range.

public static double Clamp(double value, double min, double max)

Parameters

value double

The value to clamp.

min double

The minimum value. If value is less than min, min will be returned.

max double

The maximum value. If value is greater than max, max will be returned.

Returns

double

The clamped value.

Clamp(int, int, int)

Restricts a value to be within a specified range.

public static int Clamp(int value, int min, int max)

Parameters

value int

The value to clamp.

min int

The minimum value. If value is less than min, min will be returned.

max int

The maximum value. If value is greater than max, max will be returned.

Returns

int

The clamped value.

Clamp(float, float, float)

Restricts a value to be within a specified range.

public static float Clamp(float value, float min, float max)

Parameters

value float

The value to clamp.

min float

The minimum value. If value is less than min, min will be returned.

max float

The maximum value. If value is greater than max, max will be returned.

Returns

float

The clamped value.