Text problem with stroke

Hi Guys can you explain me why the stroke doesn’t work on text?

 PFont myFont;
 int x=0;
 float y;
 float r =0;
 String s="test";
 float xPosition=500;



 void setup(){
   size(500,500);
   background(0);
   myFont=loadFont("AktivGrotesk-Black-48.vlw");
  stroke(0,255,45,45);
   textFont(myFont);
  // frameRate(10);
 }
 
 
 void draw(){
   
   
  //for(x=0;x<250; x++)
  for (y=0; y<250; y=y+50)
{
//if(y>0);
 
   
   fill(255,255,255,60);
     stroke(0,255,45,45);
 translate(150,150);
    
   text(s,200,xPosition);
 
    xPosition -=0.1;  
}
 }
1 Like

Processing doesn’t apply stroke attributes when drawing text.

1 Like

oo ok! And another question. I want my text to stop in the middle of my sketch how can i do it?

from
https://processing.org/reference/text_.html

text(s, 10, 10, 70, 80);  // Text wraps within text box
1 Like

Shows one way

PFont myFont;
int x=0;
float y;
float r =0;
String s="test";
float xPosition=548;

void setup() {
  size(500, 500);
  background(0);

  textSize(48);
  // frameRate(10);
}


void draw() {
  if (xPosition > height/2) {
    fill(255, 255, 255, 60);
    text(s, 200, xPosition);
    xPosition -= 1;
  }
}
1 Like