Skip to content

textWidth_

villares edited this page May 24, 2020 · 4 revisions

Nome

textWidth()

Exemplos

PFont font; 
font = loadFont("FFScala-32.vlw"); 
textFont(font, 32); 
 
char c = 'T'; 
float cw = textWidth(c); 
text(c, 0, 40); 
line(cw, 0, cw, 50); 
 
String s = "Tokyo"; 
float sw = textWidth(s); 
text(s, 0, 85); 
line(sw, 50, sw, 100); 

Descrição

Calculates and returns the width of any character or text string.

Sintaxe

textWidth(<font color="#996600">data</font>)

Parâmetros data char or String

Retorno

Float

Utilização

Web & Applicações

Relacionado

loadFont() PFont text() textFont()

Clone this wiki locally