# How to get the words to appear in a horizontal line rather than vertical line in p5.js?

**URL:** https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430
**Category:** Coding Questions
**Created:** [October 8, 2020, 9:56am UTC](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430 "2020-10-08T09:56:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sam101](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sam101](https://discourse.processing.org/u/sam101)
#### Post date: [October 8, 2020, 9:56am UTC](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430/1 "2020-10-08T09:56:04Z")

</div>

Hey everyone I was just wondering how do I get the words to appear in a horizontal line rather than a vertical line in this code???  
any help would be great!

```auto
var myText = 'S H O U T';
var words;

```

```auto
function setup() {
  createCanvas (windowWidth, windowHeight);
background (0);
textSize (32);
textFont ('Times');
words = myText.split (' ');

}

function draw() {
background (0);
fill (255);
for (i=0; i<words.length; i++) {
  if (frameCount >10 *i) {
    text (words[i], 20, i*30, width/2, width/2);
  }
}
}

```

---

<div class="post-metadata">

### Author: ![KaliBrain](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kalibrain/32/10811_2.png) [@KaliBrain](https://discourse.processing.org/u/KaliBrain)
#### Post date: [October 8, 2020, 11:18am UTC](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430/2 "2020-10-08T11:18:29Z")

</div>

You can change the y position (3rd parameter) of the `text()` function within the loop.  
here’s a suggestion:  
`text(words[i], 20 + i*32, 10, width/2, width/2)`  
This way the Y position remains constant while the X position changes each step.

---

<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: [October 8, 2020, 12:35pm UTC](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430/3 "2020-10-08T12:35:20Z")

</div>

> [@sam101](#):
>
> how do I get the words to appear in a horizontal line

Normal text appears in a horizontal line anyway

`text("Hello", 44,44);`
