Sets the text style for the assembly layer.
Syntax: |
---|
FWiz2DImage.SetTextStyle(textStyle = null) FWiz2DImage.SetTextStyle(styleIndex = -1) |
Parameters
Parameter | Description |
---|---|
textStyle | A DlxTextStyle object with the style of the text. |
styleIndex | Index of the style. There are 10 styles available with indexes from 0 to 9. Specifying -1 sets the default style for the assembly layer. |
Return Value
If an error occurs it returns false otherwise it returns true.
Example
Copy code | |
---|---|
function OnBuild2DImage()
{
var ctx = FWiz.Get2DImageCtx();
var style = FWiz.GetTextStyle(0);
style.SetStyle("Attribute Text");
ctx.SetTextStyle(style);
ctx.DrawText(new DlxPoint(0,0), "Hello, World.");
}
|