Skip to content

RemapAttribute

Namespace: SideXP.Core | Inherits from: PropertyAttribute

public class RemapAttribute : PropertyAttribute

Displays a value expected between "from" minimum and maximum on GUI, and remaps it in this field as a value between "to" minimum and maximum.

Constructors

RemapAttribute()

public RemapAttribute()

Displays a value expected between 0 and 100 on GUI, and remaps it in this field as a value between 0 and 1.

RemapAttribute(float, float)

public RemapAttribute(float fromMax, float toMax)

Displays a value expected between 0 and fromMax on GUI, and remaps it in this field as a value between 0 and toMax.

Parameters

  • fromMax: The maximum value displayed on GUI.
  • toMax: The maximum field value.

RemapAttribute(float, float, float, float)

public RemapAttribute(float fromMin, float fromMax, float toMin, float toMax)

Displays a value expected between fromMin and fromMax on GUI, and remaps it in this field as a value between toMin and toMax.

Parameters

  • fromMin: The minium value displayed on GUI.
  • fromMax: The maximum value displayed on GUI.
  • toMin: The minimum field value.
  • toMax: The maximum field value.

Properties

FromMin

public float FromMin

The minium value displayed on GUI.

FromMax

public float FromMax

The maximum value displayed on GUI.

ToMin

public float ToMin

The minimum field value.

ToMax

public float ToMax

The maximum field value.

Units

public string Units

The unit to display on GUI.

Clamped

public bool Clamped

If enabled, the value is clamped between its allowed bounds.