# Salto de línea automático en texto

**URL:** https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671
**Category:** Español
**Created:** [November 20, 2019, 10:28pm UTC](https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671 "2019-11-20T22:28:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)
#### Post date: [November 20, 2019, 10:28pm UTC](https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671/1 "2019-11-20T22:28:36Z")

</div>

Estoy programando en fullscreen() y necesito que un texto se divida automáticamente en las líneas necesarias para aparecer completo en pantallas de varios tamaños. ¿Cómo puedo hacerlo?  
¡Gracias!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 20, 2019, 10:41pm UTC](https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671/2 "2019-11-20T22:41:55Z")

</div>

```auto
text(miTexto,13,13, 
  width-26, height-26);

```

---

<div class="post-metadata">

### Author: ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)
#### Post date: [November 21, 2019, 5:20pm UTC](https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671/3 "2019-11-21T17:20:41Z")

</div>

Gracias, Chrisir,

He conseguido algo parecido a lo que quería con el siguiente código, pero no sé muy bien lo que he hecho con el height-, es decir, lo he conseguido probando, a ciegas. Mi pregunta es la siguiente, cuando deje de visualizarlo en un pc y lo visualice en la pantalla vertical de una tablet, seguirá funcionando?

```auto
void setup(){
  fullScreen();
  background(0,0,0);
  noStroke();
} 

void draw (){
  String a = "1. Cuenta cada círculo que aparece en la pantalla.";
  String b = "2. Mantén tu atención en los círculos que estás contando.";
  String c = "3. Cada vez que te distraigas, devuelve tu atención a la cuenta de círculos.";
  fill(255);
  textSize(height/21);
  textAlign(LEFT, CENTER);
  text(a, width/20, height/6, width-40, height-725);
  textSize(height/21);
  textAlign(LEFT, CENTER);
  text(b, width/20, height/3, width-40, height-715);
  textSize(height/21);
  textAlign(LEFT, CENTER);
  text(c, width/20, height/2, width-40, height-650);
}

```

---

<div class="post-metadata">

### Author: ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)
#### Post date: [November 21, 2019, 8:32pm UTC](https://discourse.processing.org/t/salto-de-linea-automatico-en-texto/15671/4 "2019-11-21T20:32:22Z")

</div>

> [@humano](#):
>
> vertical de una tablet, seguirá funcionando?

You could quickly test it on your pc by switching `fullScreen();` with `size(w, h);`, where `w` and `h` can be any value you want. I recommend testing it with common proportions (such as 9:16) in various sizes.

Keep in mind that testing like this is not a 100% guarantee it will also look good on an actual tablet, but it’s a decent test method for the time being.
