Automatic line change

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:

Sorry for the mistakes I use the Google Translate

Can you help me solve my problem ?
Thanks

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

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

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

More info can be found in the reference.

3 Likes

thank you very much it works very well.