# How to jump the line when it reaches the limit of a window?

**URL:** <https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [November 18, 2020, 2:54am UTC](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501 "2020-11-18T02:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmmanuelHra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/emmanuelhra/32/10688_2.png) [@EmmanuelHra](https://discourse.processing.org/u/EmmanuelHra)\
**Post date:** [November 18, 2020, 2:54am UTC](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501/1 "2020-11-18T02:54:22Z")

</div>

I am working in processing and I have to print the following:

 ![Impresion](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c57a190e4c887789a45f56549360ea5dd5348121.png)  
What I want to do is that when the limit of the window of a line break is reached and I write the letter just below the first P, I will make the line break but write the letter at the end and not at the beginning. I hope you can help me I leave the piece of code where I am trying to do this:

```auto
void letrero(int px,int py, String cadena)
{    
   for (int i=0; i<cadena.length(); i++)
   {
           
       if(sumatoria >=470 ){
         py = py+30;
         px = 10;  
      }
       
        dibujaletra(px+20*i*escala, py, alfabeto[int(cadena.charAt(i))] );         
        sumatoria = px+20*i*escala;       
        println(sumatoria);
   }
}   

```

---

<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 18, 2020, 7:00am UTC](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501/2 "2020-11-18T07:00:50Z")

</div>

px is not your writing position

The if clause is good

But increase px every time and use it as dibujaletra / text parameter

---

<div class="post-metadata">

**Author:** ![EmmanuelHra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/emmanuelhra/32/10688_2.png) [@EmmanuelHra](https://discourse.processing.org/u/EmmanuelHra)\
**Post date:** [November 18, 2020, 2:22pm UTC](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501/3 "2020-11-18T14:22:52Z")

</div>

thanks for the idea Chrisir
