目录
当前位置: 首页 > 文档资料 > Snap.svg 英文文档 >

Paper.text(x, y, text)

优质
小牛编辑
120浏览
2023-12-01

Draws a text string

Parameters

  1. xnumberx coordinate position
  2. ynumbery coordinate position
  3. textstringarrayThe text string to draw or array of stringsto nest within separate <tspan> elements

Returns: object the text element

Usage

var t1 = paper.text(50, 50, "Snap");
var t2 = paper.text(50, 50, ["S","n","a","p"]);
// Text path usage
t1.attr({textpath: "M10,10L100,100"});
// or
var pth = paper.path("M10,10L100,100");
t1.attr({textpath: pth});