SCE Ticker / Scrolling Text

   Print  Previous  Next

Functions Provided By SCE Ticker / Scrolling Text

This effect uses the following functions:

This Effect uses Directions. Learn more »Using Direction
This Effect uses Look-At Types. Learn more »Using Look-At Types
This Effect uses the BPM Control. Learn more »Using BPM Control
This Effect uses the Color Controls. Learn more »Using Color Controls
This Effect uses the Position Controls. Learn more »Using Position Controls
 

 Function

Description

void SetExtrusion(float value)

Sets the Extrusion value in percent of the matrix size (depending on the current look-at type).

float GetExtrusion()

Returns the current Extrusion value in percent of the matrix size (depending on the current look-at type).

void SetPixelExtrusion(int value)

Sets the Extrusion value in pixels.

int GetPixelExtrusion()

Returns the current Extrusion value in pixels.

void SetRotation(int angle)

Sets the Rotation globally for all images of the Image List. It is possible to rotate the images by multiples of 90°. This function is equal to the rotation button provided by the GUI of the effect. Valid values for angle are 0, 90, 180, and 270.

int GetRotation()

Returns the currently set Rotation.

void SetTiling(int enable)

Disables Tile Mode if enable is set to FALSE, otherwise the Tile Mode will be enabled via TRUE.

int GetTiling()

Returns TRUE if Tile Mode is enabled, otherwise FALSE.

void ToggleTiling()

Enables Tile Mode or uses the default setting, depending on the current state.

void SetSeamless(int enable)

Disables Seamless if enable is FALSE, otherwise it will be enabled.

int GetSeamless()

Returns TRUE if Seamless is enabled, otherwise FALSE.

void ToggleSeamless()

Enables Seamless or uses the default setting, depending on the current state.

float GetImageWidth()

Returns the image width of the current image in percent of the matrix width.

float GetImageHeight()

Returns the image height of the current image in percent of the matrix height.

float GetImageDepth()

Returns the image depth of the current image in percent of the matrix depth.

int GetImagePixelWidth()

Returns the image width of the current image in pixels.

int GetImagePixelHeight()

Returns the image height of the current image in pixels.

int GetImagePixelDepth()

Returns the image depth of the current imagein pixel.

float GetCurrentPositionX()

Returns the X-position of the current image in percent of the matrix width.

float GetCurrentPositionY()

Returns the Y-position of the current image in percent of the matrix height.

float GetCurrentPositionZ()

Returns the Z-position of the current image in percent of the matrix depth.

int GetCurrentPixelPositionX()

Returns the X-position of the current image in pixels.

int GetCurrentPixelPositionY()

Returns the Y-position of the current image in pixels.

int GetCurrentPixelPositionZ()

Returns the Z-position of the current image in pixels.

void SetText(string text)

Sets the Text the effect displays.

string GetText()

Retrieves the Text shown by the effect.

void SetTextSplittingMode(int mode)

Sets the text Splitting mode. See below for further details.

int GetTextSplittingMode()

Returns the current text Splitting mode. See below for further details.

viod SetReverseCharacters(int enable)

Disables Reverse Characters if enable is set to FALSE. Otherwise, use TRUE.

int GetReverseCharacters()

Returns true if Reverse Characters is active, otherwise FALSE is returned.

void SetReverseWords(int enable)

Disables Reverse Characters if enable is set to FALSE. Otherwise, use TRUE.

int GetReverseWords()

Returns TRUE if Reverse Characters is active, otherwise FALSE is returned.

int GetFontWidth()

Returns the Width of the currently used font.

void SetFontWidth(int width)

Sets the Width of the font.

int GetFontHeight()

Returns the Height of currently used font.

void SetFontHeight(int height)

Sets the Height of the font.

int GetFontItalic()

Returns if the font used is in italics.

void SetFontItalic(int value)

Sets the font in italics (value = TRUE) or not (value = FALSE).

int GetFontUnderline()

Returns if the currently used font is underlined.

void SetFontUnderline(int value)

Sets underlining for the font (value = TRUE) or not (value = FALSE).

int GetFontStrikeOut()

Returns if the a strikeout font is used.

void SetFontStrikeOut(int value)

Sets strikeout for the font (value = TRUE) or not (value = FALSE).

int GetFontWeight()

Returns the Weight of the currently used font.

void SetFontWeight(int value)

Sets the Weight of the font. Valid values for value range from 0 to 1000.

string GetFontFaceName()

Returns the Name of the font currently in use.

void SetFontFaceName(string name)

Sets which font to use. Use the exact font name. A maximum of 31 characters is allowed for string. Example: SetFontFaceName("Arial");

void SetStretchMode(int mode)

Sets the Stretch mode. See below for details.

int GetStretchMode()

Returns the Stretch mode. See below for details.

void SetFilteringMode(int mode)

Sets the Filtering mode. See below for details.

int GetFilteringMode()

Returns the Filtering mode. See below for details.

 

Stretch Mode Constants

Value

Description

int STRETCH_MODE_NONE

Sets the stretch mode to None (no stretching).

int STRETCH_MODE_MATRIX

Sets the stretch mode to Matrix (stretches to the current aspect ratio of the matrix).

int STRETCH_MODE_ORIGINAL

Sets the stretch mode to Original (stretches to the original aspect ratio of the source).

int STRETCH_MODE_4_TO_3

Sets the stretch mode to 4:3.

int STRETCH_MODE_16_TO_9

Sets the stretch mode to 16:9.

 

Filtering Mode Constants

Value

Description

int FILTERING_MODE_NEAREST_NEIGHBOR

Sets the Filtering Mode to None (no filtering).

int FILTERING_MODE_LINEAR

Sets the Filtering Mode to Linear (may require additional performance).

 

Text Mode Constants

The ticker effect supports different modes. The given text can be interpreted as a whole sentence, as single words, or even single characters. With the function SetTextSplittingMode it is possible to set the mode using the following parameters:

Constant

Description

int MODE_SENTENCE

Sets the sentence mode (Splitting None).

int MODE_WORD

Sets the word mode (Splitting Words).

int MODE_CHAR

Sets the character mode (Splitting Characters).

 

MADRIX 2.X To MADRIX 3.X Migration Hints
The following functions and constants are not supported anymore. Please follow the hints to migrate your macros.

Function/Define

Description

void SetTextMode(int mode)

Use void SetTextSplittingMode(int mode) instead.

void GetTextMode(int mode)

Use int GetTextSplittingMode() instead.

void SetReverseWord(int enable)

Use void SetReverseWords(int enable) instead.

int GetReverseWord()

Use int GetReverseWords() instead.

void SetReverseSentence(int enable)

Use void SetReverseCharacters(int enable) instead.

int GetReverseSentence()

Use int GetReverseCharacters() instead.

void SetTextColor(color col)

Use void SetColor(color col) instead.

color GetTextColor()

Use color GetColor() instead.

TM_SENTENCE

Use MODE_SENTENCE instead.

TM_WORD

Use MODE_WORD instead.

TM_CHAR

Use MODE_CHAR instead.

void SetPixelTextOffset(int x, int y)        

Use void SetPixelPosition(int x, int y, int z) instead.

int GetPixelTextOffsetX()

Use int GetPixelPositionX() instead.

int GetPixelTextOffsetY()

Use int GetPixelPositionY() instead.

int GetPixelTextPosX()

Use int GetCurrentPixelPositionX() instead.

int GetPixelTextPosY()        

Use int GetCurrentPixelPositionY() instead.

void SetSmooth(int enable)

Use void SetStep(int enable) instead.

int GetSmooth()

Use int GetStep() instead.

int GetPixelTextWidth()

Use int GetImagePixelWidth() instead.

int GetPixelTextHeight()

Use int GetImagePixelHeight() instead.

void SetDir(int)

Use void SetDirection(int) instead.

void SetStop(int)

Use void SetDirection(DIRECTION_NONE) instead.

 

Full Example 1

The following example writes the current time onto the matrix. Furthermore, it moves the text from side to side.

time g_time = GetTime();

 

void InitEffect()

{

    SetText("Hallo Dresden");

    SetDirection(DIRECTION_TOP);

}

 

void PreRenderEffect()

{

    time t = GetTime();

 

    int diff = t.sec - g_time.sec;

 

    if(diff > 0 || diff < 0) {

        g_time = t;

        string s;

        if(g_time.hour < 10) {

            s += "0";

        }

        s += (string)g_time.hour;

        s += ":";

 

        if(g_time.min < 10)

            s += "0";

        s += (string)g_time.min;

        

        s += ".";

 

        if(g_time.sec < 10)

            s += "0";

        s += (string)g_time.sec;

 

        SetText(s);

    }

 

    if(GetDirection() == DIRECTION_LEFT) {

        if(GetCurrentPixelPositionX() < 0) {

            SetDirection(DIRECTION_RIGHT);

        }

    } else if(GetDirection() == DIRECTION_RIGHT) {

        if(GetCurrentPixelPositionX() > GetMatrixWidth()- GetImagePixelWidth()) {

            SetDirection(DIRECTION_LEFT);

        }

    } else {

            SetDirection(DIRECTION_LEFT);

    }

}

 

void PostRenderEffect()

{

    int i = 128;

    ClearAlpha(i);

    WriteText(GetText());

}

 

int compareTimes(time t1, time t2)

{

    int result = 0;

    if(t1.hour < t2.hour)

        result = -1;

    else if(t1.hour > t2.hour)

        result = 1;

    else {

        if(t1.min < t2.min)

            result = -1;

        else if(t1.min > t2.min)

            result = 1;

        else {

            if(t1.sec < t2.sec)

                result = -1;

            else if(t1.sec > t2.sec)

                result = 1;

        }

 

    }

 

    return(result);

}

 

Full Example 2

This example includes SetText and GetTime.

 

Example 3

This example creates a digital clock and therefore displays the current time using the SCE Ticker Effect.

@scriptname="macro clock with sce_ticker";

@author="sven";

@version="1.0";

@description="write the current time into the ticker text fields";

 

void InitEffect()

{

 

}

 

void PreRenderEffect()

{        

   time t = GetTime();

   SetText(ZeroString(t.hour) + ":" + ZeroString(t.min) + ":" + ZeroString(t.sec));

}

 

void PostRenderEffect()

{

}

 

void MatrixSizeChanged()

{

 InitEffect();

}

 

string ZeroString(int value)

{

          if(value<10)

                     return "0"+(string)value;

                  return (string)value;

}

 

MADRIX Version: 3.6j | Script Version: 2.22
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
Print   Previous   Next