NinjaScript > Language Reference > Drawing >

IText

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Represents an interface that exposes information regarding a Text IDrawObject.

 

Methods and Properties

BarsAgo

An int value representing the number of bars ago of the draw object

Time

A DateTime structure representing the time of the draw object

Y

An int value representing the y value of the draw object

YPixelOffset

An int value representing the offset value in pixels from within the text box area

Alignment

Possible values are:

 

StringAlignment.Center
StringAlignment.Far
StringAlignment.Near
(reference)

AreaOpacity

An int value representing the opacity of the area color

AreaColor

A Color structure representing the fill color of the text box

Text

A string value representing the text to be drawn

TextColor

A Color structure representing the color of the text

Font

A Font object representing the font for the text

Pen

The Pen object used to outline the text box

 

 

Examples

protected override void OnBarUpdate()
{

    // Draws a text object
    IText text = DrawText("tag1", "Text to draw", 10, 1000, Color.Black);

 

    // Print the text drawn on the chart

    Print(text.Text);
}