Enfusion Script API
Loading...
Searching...
No Matches
CurveColor Interface Reference

Curve class for Color values. More...

Inheritance diagram for CurveColor:
Managed

Public Member Functions

proto external void Compute (float param, out notnull Color color)
 Compute value at x.
 
proto external bool IsEmpty ()
 Is the curve empty and thus using default value?
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Detailed Description

Curve class for Color values.

Expected to use as a property (using Attribute) and filled from config edited in dedicated Curve dialog in Workbench. UIWidgets.CurveDialog for property params details

class ConfigExample
{
[Attribute(uiwidget: UIWidgets.CurveDialog, params:"type=Akima, ends=OpenFlat, paramRange=0 1 fixed, valueRange=0 1 fixed")]
ref CurveColor m_Curve;
}
void UsageExample(ConfigExample c)
{
Color val = Color.Black;
for (int i = 0; i < 10; i++)
{
c.m_Curve.Compute(0.1 * i, val);
Print("[" + i + "] = " + val);
}
}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
Definition attributes.c:285
Definition Color.c:13
static const ref Color Black
color constants - color objects
Definition Color.c:40
Curve class for Color values.
Definition CurveColor.c:35
Definition attributes.c:38
static const string CurveDialog
Definition attributes.c:261

Member Function Documentation

◆ Compute()

proto external void CurveColor.Compute ( float param,
out notnull Color color )

Compute value at x.

This method finds segment which x belongs to and performs local interpolation.

◆ IsEmpty()

proto external bool CurveColor.IsEmpty ( )

Is the curve empty and thus using default value?


The documentation for this interface was generated from the following file: