# Automatic line change

**URL:** <https://discourse.processing.org/t/automatic-line-change/2342>\
**Category:** Processing for Android\
**Created:** [August 3, 2018, 9:57pm UTC](https://discourse.processing.org/t/automatic-line-change/2342 "2018-08-03T21:57:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugo](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@hugo](https://discourse.processing.org/u/hugo)\
**Post date:** [August 3, 2018, 9:57pm UTC](https://discourse.processing.org/t/automatic-line-change/2342/1 "2018-08-03T21:57:15Z")

</div>

Hello,  
While writing a little program on android processing, I encountered a problem ,I would like to know if it is possible to line up automatically when the text meets the right edge of the screen :

void setup () {  
background (0);  
fullScreen();  
}

void draw () {  
textSize(height/20);  
fill(255);  
text(“Click here to go to the next level”,width/100,height/2);  
}

Here are the image:

 ![Screenshot_20180731-120442](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/9f155a32b00841d847f9d170f1f7cb31b749c2f0.jpg)

Sorry for the mistakes I use the Google Translate

Can you help me solve my problem ?  
Thanks

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [August 3, 2018, 10:00pm UTC](https://discourse.processing.org/t/automatic-line-change/2342/2 "2018-08-03T22:00:49Z")

</div>

The `text()` function takes a `width` and `height` parameter which allows you to specify a bounding box:

```auto
size(200, 300);
background(32);
textSize(18);
text("this is a lot of text it's too long to fit in the window", 0, 50, width, 250);

```

![ss](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/62ffbf87bbf8f658a5a68ef60865d2d8faa55255.png)

You could also use the `textAlign()` function to align your text.

More info can be found in [the reference](https://processing.org/reference/).

---

<div class="post-metadata">

**Author:** ![hugo](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@hugo](https://discourse.processing.org/u/hugo)\
**Post date:** [August 4, 2018, 12:53pm UTC](https://discourse.processing.org/t/automatic-line-change/2342/3 "2018-08-04T12:53:33Z")

</div>

thank you very much it works very well.
