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

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!

var myText = 'S H O U T';
var words;
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);
  }
}
}

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.

2 Likes

Normal text appears in a horizontal line anyway

text("Hello", 44,44);