VS.Title()

You can add a title to your visual by adding an instance of VS.Title() to a VS.Document() object:

myTitle=myDocument.AddTitle(titlestring);

Let's say that the titlestring parameter passed is "This is a Title for a Flowchart," this will be the result:

VisualScript title

A title is a shape without a border that contains a text label that is automatically placed at the top and center of the visual created by a VisualScript document. There can only be one title per document. Using AddTitle() a second time overwrites the first title.

VS.Title Methods

Titles support all of the VS.Shape() methods that affect the appearance of text.

SetTextBold()

Example

myTitle.SetTextBold(true);

Syntax

myTitle=myTitle.SetTextBold(bold);

Usage

This method sets the title text to bold when true.

SetTextColor()

Example

myTitle.SetTextColor("#0000FF");

Syntax

myTitle=myTitle.SetTextColor(color);

Usage

This method overrides the color of the title text.

A color can be:

  • A string specifying an RGB literal in HTML format - "#FF00FF"
  • A string specifying an RGBA literal in HTML format - "#FF00FF80" - where the last byte is an opacity
  • A string specifying the name of a standard color defined by the VS.Document() SetColors() method

SetTextFont()

Example

myTitle.SetTextFont("Copperplate");

Syntax

myTitle=myTitle.SetTextFont(fontname);

Usage

This method overrides the font setting of the title.

Example

myTitle.SetTextHyperlink("https://www.smartdraw.com");

Syntax

myTitle=myTitle.SetTextHyperlink(url);

Usage

This method adds a hyperlink to the text.

SetTextItalic()

Example

myTitle.SetTextItalic(true);

Syntax

myTitle=myTitle.SetTextItalic(italic);

Usage

This method makes the title text italic when set to true.

SetTextSize()

Example

myTitle.SetTextSize(18);

Syntax

myTitle=myTitle.SetTextBold(textsize);

Usage

This method overrides the default Title text size in points.

SetTextUnderline()

Example

myTitle.SetTextUnderline(true);

Syntax

myTitle=myTitle.SetTextUnderline(underline);

Usage

This method underlines the Title text.

By continuing to use the website, you consent to the use of cookies.   Read More