Using Text |
Print Previous Next |
Functions Provided For Setting Text The following table provides an overview of all functions to modify text:
Remarks Not all effects which use text offer the text splitting mode as well as the possibilities to render repeated text and to reverse the words/characters. Therefore, the appropriate functions are only available if the effect offers the features.
Deprecated Functions Deprecated functions are outdated functions and should not be used anymore.
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.
This macro example for SCE Graph parses the displayed text for comma-separated format tags: "italic", "bold" and font face names are recognized. Numbers are interpreted as font height. It works with the »SCE Graph effect, for example. Just set the shape type to text and edit it. For example, set the text to "italic, Comic Sans MS, 16" and the text is displayed automatically with this format. Of course, the same text is displayed on the matrix. That is why this is only a test scenario. @scriptname=""; @author=""; @version=""; @description="";
void InitEffect() { SetShapeType(SHAPE_TYPE_TEXT); }
void PreRenderEffect() { // default values int fontHeight = 12; int fontWeight = 400; int isItalic = false; string faceName = "Arial"; string text = EditableTextGetText(), token; string tokens[];
// parse values tokenize(text, ",", tokens);
for (int i = 0; i < tokens.length; i++) { token = tokens[i]; tolower(token); // compare keywords case-insensitive strip(token); // remove whitespace around keywords
if (token.length == 0) continue; else if (isnum(token) == true) fontHeight = (int)token; else if (token == "bold") fontWeight = 800; else if (token == "italic") isItalic = true; else faceName = token; }
// set values EditableTextSetFontHeight(fontHeight); EditableTextSetFontWeight(fontWeight); EditableTextSetFontItalic(isItalic); EditableTextSetFontFaceName(faceName); }
void PostRenderEffect() {
}
void MatrixSizeChanged() { InitEffect(); }
|
MADRIX Version: 3.6j | Script Version: 2.22 |
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100% |
Print Previous Next |