<< Click to Display Table of Contents >>
new sg.symbols.TextSymbol(text, font, color)
Description
建立一個(具有參數的)TextSymbol 物件。
Position
Symbol.js
Parameters
Parameter |
Type |
Description |
text_or_json |
String |
(optional)文字內容的定義。 |
font |
sg.Font |
(optional)字體定義。 |
color |
sg.Font |
(optional)文字的顏色。 |
Constants
Constants |
Description |
ALIGN_END |
向右對齊。 |
ALIGN_MIDDLE |
靠中對齊。 |
ALIGN_START |
向左對齊。 |
DECORATION_LINETHROUGH |
刪除線。 |
DECORATION_NONE |
無字體裝飾。 |
DECORATION_OVERLINE |
上行線。 |
DECORATION_UNDERLINE |
底線。 |
Properties
Properties |
Type |
Description |
align |
String |
對齊方式定義。 |
angle |
Number |
旋轉角度定義。 |
color |
sg.Color |
文字的顏色。 |
font |
sg.Font |
字體定義。 |
kerning |
String |
文字間是否相隔間距的定義。 |
rotated |
Boolean |
各文字字串是否旋轉的定義。 |
text |
String |
文字內容的定義。 |
type |
String |
符號的類型。 |
xoffset |
Number |
x 方向偏移量的定義。 |
yoffset |
Number |
y 方向偏移量的定義。 |
Methods
Methods |
Type |
Description |
|||||||||
setAlign(align) |
String |
設定文字對齊方式。 (參考Constants列舉定義)
|
|||||||||
setAngle(angle) |
Number |
設定文字旋轉角度。
|
|||||||||
setColor(color) |
sg.Color |
設定文字顏色。
|
|||||||||
setFont(font) |
sg.Font |
設定文字字體。
|
|||||||||
setKerning(kerning) |
String |
設定文字間相隔間距。
|
|||||||||
setOffset(x,y) |
Number |
設定x 與y 方向偏移量。
|
|||||||||
setRotated(rotated) |
Boolean |
設定各文字字串是否旋轉。
|
|||||||||
setText(text) |
String |
設定文字內容。
|
Example
|
©2015 Supergeo Technologies Inc.