About text() function

//Pressure Chart Value
fill(#D6CDCD);
stroke(#000000);
rect(260,325,200,40,50);
fill(#FF301E);
text(f[7],340,110);
//Height Chart Value
fill(#D6CDCD);
stroke(#000000);
rect(260,285,200,40,50);
fill(#FF301E);
text(f[8],380,150);
//Voltage Chart Value
fill(#D6CDCD);
stroke(#000000);
rect(260,245,200,40,50);
fill(#FF301E);
text(f[9],380,190);

I cant see those texts where are they.Their X Y Axis locations are true but I didn’t understand where are they

Green text under the blue boxes?

They are red actually you can see it in the first photo. Even if they are green I would be able to see them because boxes are not blue they are literally grey

1 Like

So I guess no one will help me

Hello,

You did not ask for help.

You just made a statements:

About text() function

Can someone please @SouSageYa ?

Sure! Since you ask so nicely.

I added some code so I could test what you provided:

void setup()
  {
  size(500, 500);
  textSize(24);
  
  //Pressure Chart Value
  fill(#D6CDCD);
  stroke(#000000);
  rect(260,325,200,40,50);
  fill(#FF301E);
  text("test",340,110);
  
  //Height Chart Value
  fill(#D6CDCD);
  stroke(#000000);
  rect(260,285,200,40,50);
  fill(#FF301E);
  text("test",380,150);
  
  //Voltage Chart Value
  fill(#D6CDCD);
  stroke(#000000);
  rect(260,245,200,40,50);
  fill(#FF301E);
  text("test",380,190);
  }

This is a snippet of code; how this will behave in the larger context of your project is not known.

:)

1 Like

Actually I didn’t ask this forum to write the code or something. I just wanted to learn why are those texts are being hidden at the back of those boxes even the other ones are not. like the code/photo that you attached. Thanks @glv

I can’t run your code.

It is vital

  • that you say fill BEFORE the text that uses the color and
  • that you draw the text AFTER the rectangle it is upon.

Maybe you can provide a MCVE?

Thank you!

Chrisir

Its about the source code I guess when I tried to code those texts somewhere else it worked thanks for everything much love.

2 Likes