Functions Provided By SCE Radial
The following table provides an overview of all functions the effect can use:
Function
|
Description
|
void SetColor(color c)
|
Sets the effect color.
|
color GetColor()
|
Returns the current effect color.
|
void SetBpm(int speed)
|
Set the speed of the effect in BPM. Valid values range from 0 to 9999 BPM.
|
int GetBpm()
|
Returns the current effect speed in BPM.
|
void SetLength(int length)
|
Sets the length of the effect. Valid values range from 0 to 100.
|
int GetLength()
|
Returns the current length.
|
void SetCount(int number)
|
Sets the helix count, which means the number of helixes to draw. number must be greater than 0.
|
int GetCount()
|
Returns the current helix count.
|
void SetPixelCenter(int x, int y)
|
Sets the center for the effect in pixel coordinates.
|
int GetPixelCenterX()
|
Returns the current x coordinate of the center in pixels.
|
int GetPixelCenterY()
|
Returns the current y coordinate of the center in pixels.
|
void SetVectorCenter(float x, float y)
|
Sets the center for the effect using relative coordinates.
|
float GetVectorCenterX()
|
Returns the current x coordinate of the center using relative coordinates.
|
float GetVectorCenterY()
|
Returns the current y coordinate of the center using relative coordinates.
|
void SetEffectMode(int mode)
|
Sets the effect mode. See below for further details.
|
int GetEffectMode()
|
Returns the currently set effect mode. See below for further details.
|
void SetCurve(int curve)
|
Sets the curve mode. Valid values are 0 to 5 or the defines described below.
|
int GetCurve()
|
Returns the currently used curve. See SetCurve for valid values.
|
void SetRotation(int direction)
|
Sets the direction of the rotation to clockwise or counter-clockwise. See table below for possible values of direction.
|
int GetRotation()
|
Returns the current rotation direction. See table below for possible return values.
|
void SetDirection(int direction)
|
Sets the direction of the helix and the circle from center to the outside or vice versa. See below for further details.
|
int GetDirection()
|
Returns the current direction. See below for further details.
|
void SetFactor(int factor)
|
Sets the current factor value. Valid values range from 0 to 100.
|
int GetFactor()
|
Returns the current factor value.
|
void SetAmplitude(int amplitude)
|
Sets the current amplitude value. Valid values range from 0 to 100.
|
int GetAmplitude()
|
Returns the current amplitude value.
|
This Effect uses the Color Picker. Learn more about Using Colors.
Deprecated Functions
Deprecated functions are outdated functions and should not be used anymore.
Function
|
Description
|
void SetSpeed(int speed)
|
Sets the speed of the effect in FPS. Valid values range from 0 to 166. Please note: This function is deprecated and may be removed in one of the next releases. Use SetBpm instead.
|
float GetSpeed()
|
Returns the current effect speed in FPS. Please note: This function is deprecated and may be removed in one of the next releases. Use GetBpm instead.
|
Effect Modes
The radial effect supports the effect types "circle", "radar" and "helix". The function SetEffectMode can be used to set them. The following table provides an overview about the possible values as parameters for that function:
Value
|
Description
|
EFFECT_CIRCLE
|
Sets the "circle-mode".
|
EFFECT_RADAR
|
Sets the "radar-mode".
|
EFFECT_HELIX
|
Sets the "helix-mode".
|
Curve Modes
The radial effect supports different types of curves. The function SetCurve can be used to set them. The following table provides an overview about additional parameters:
Value
|
Description
|
CURVE_SIN
|
Sets a "sine" curve.
|
CURVE_PHASE
|
Sets the "phase" mode.
|
CURVE_ABSSIN
|
Uses an absolute value of sine for a curve.
|
CURVE_SAWTOOTH_DOWN
|
Sets the" sawtooth down" mode.
|
CURVE_SAWTOOTH_UP
|
Sets the "sawtooth up" mode.
|
CURVE_TRIANGLE
|
Uses a triangle curve.
|
Rotation Direction
The "radar"- and the "helix" - modes have two possible directions how to rotate: clockwise and anticlockwise. The function SetRotation may be used to set those directions, using the following values as parameter:
Value
|
Description
|
ROTATION_CW
|
Sets a clockwise rotation.
|
ROTATION_CCW
|
Sets a counter clockwise rotation.
|
Effect Direction
The "circle" mode supports outward and inward movements. The "helix" supports the same settings, but uses them in different ways. However, to set those directions, use the function SetDirection with the following values:
Value
|
Description
|
DIR_OUTWARDS
|
Sets direction to "outwards".
|
DIR_INWARDS
|
Sets direction to "inwards".
|
Full Example
The following example will move the center of the radial effect and change its colors as well as modes at the same time.
int g_dir;
float g_posX, g_posY;
const float g_speed = 1.25;
void InitEffect()
{
}
void PreRenderEffect()
{
switch(g_dir)
{
case 0: //left
if(g_posX <= 0.0) {
g_dir++;
g_posX = 0.0;
} else {
g_posX -= g_speed;
}
break;
case 1: //up
if(g_posY <= 0.0) {
g_dir++;
g_posY = 0.0;
SetNextMode();
} else {
g_posY -= g_speed;
}
break;
case 2: //right
if(g_posX > (float)GetMatrixWidth()) {
g_dir++;
g_posX = (float)GetMatrixWidth();
} else {
g_posX += g_speed;
}
break;
case 3: //down
default:
if(g_posY >= (float)GetMatrixHeight()) {
g_dir = 0;
g_posY = (float)GetMatrixHeight();
} else {
g_posY += g_speed;
}
}//switch
SetPixelCenter((int)g_posX, (int)g_posY);
}
void SetNextMode()
{
if(GetEffectMode() == EFFECT_CIRCLE)
SetEffectMode(EFFECT_RADAR);
else if(GetEffectMode() == EFFECT_RADAR)
SetEffectMode(EFFECT_HELIX);
else {
SetEffectMode(EFFECT_CIRCLE);
if(GetCurve() == 1)
SetCurve(CURVE_SIN);
else
SetCurve(CURVE_PHASE);
}
}
void PostRenderEffect()
{
}
|