KitchenDraw SDK 2
Show / Hide Table of Contents

Method TryPlaceText

TryPlaceText(string, double, out Object, TextColor, TextColor, ViewType, Object, double, double, int, bool)

Places a special type of object in the scene that displays the specified text.

Declaration
public bool TryPlaceText(string text, double textHeight, out Scene.Object placedObject, Scene.TextColor backgroundColor = TextColor.None, Scene.TextColor foregroundColor = TextColor.Black, Scene.ViewType viewType = (Scene.ViewType)-1, Scene.Object hostObject = null, double x = 0, double y = 0, int angleInDegrees = 0, bool centered = false)
Parameters
Type Name Description
string text

A text to display

double textHeight

A height of text (in scene units)

Scene.Object placedObject

Placed object that represents the text

Scene.TextColor backgroundColor

Background color of the text

Scene.TextColor foregroundColor

Foreground color of the text

Scene.ViewType viewType

View type on which the text is shown. -1 may be specified to denote current view.

Scene.Object hostObject

An object that will host the text. If null, the text object is standalone.

double x

If the text is hosted by another object, denotes X offset from the object's center. If the text is standalone, denotes X position of the text in scene coordinate space.

double y

If the text is hosted by another object, denotes Y offset from the object's center. If the text is standalone, denotes Y position of the text in scene coordinate space.

int angleInDegrees

Rotation angle for the text, in degrees, counterclock-wise.

bool centered

If true, the (x,y) position denotes the center of the text object. Otherwise, (x,y) denotes the left bottom corner of the area representing the text.

Returns
Type Description
bool

true if no error appeared and the text was placed, false otherwise.

In this article
Back to top Generated by DocFX