Set text orientation?

Is there a way to print text using the text() function in p5 to display text vertically (i.e. rotated 90 degrees counter-clockwise)?

Answers

  • Answer ✓
    size(200,200);
    textSize(20);
    textAlign(CENTER,CENTER);
    background(0);
    fill(0,255,0);
    translate(100,100);
    rotate(HALF_PI);
    text("Yes there is!", 0, 0);
    
  • Great. Thanks!

  • If you're referring to text on the canvas then you can move/rotate this just like anything else drawn to canvas:

    textSize(32);
    translate(20, 10);
    rotate(PI/2);
    text("word", 0, 0);
    
Sign In or Register to comment.