We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › text() over text()
Page Index Toggle Pages: 1
text() over text() (Read 499 times)
text() over text()
Sep 4th, 2008, 10:55am
 
Hello

I'm quite new to processing. I got the problem
with the text() tool. So I like to print the
current temperature and as you know it does change.
So I tried it with text(temperature, 0,0) But as
soon as the temperature changes you can't read it
anymore because it does overwrite the old value...

By the way I can’t set the Background back to a colour
because there is a Graph which is showing the temperature
trend.

How can I do that?

Thx
Geko
Re: text() over text()
Reply #1 - Sep 4th, 2008, 10:59am
 
You do need to use background.. and then redraw both the graph and text each time.
Re: text() over text()
Reply #2 - Sep 4th, 2008, 11:01am
 
hmm okay

I tired this:

 fill(0, 0, 0);
 text(lastsensorValue + "C", 0, 0);
 fill(255, 0, 0);
 text(sensorValue + "C", 0, 0);
 lastsensorValue=sensorValue;

It works but I think all of you get a shock Cheesy
Re: text() over text()
Reply #3 - Sep 4th, 2008, 11:26am
 
With this code

size(200, 50);
background(0);

It doesn't paint all the surface black. Why? There is still some space left.

with
size(200, 200);
background(0);

no problem but it's too big for my application..

What can I do?

Thx
Geko
Re: text() over text()
Reply #4 - Sep 4th, 2008, 12:43pm
 
I fear this is not the right place for this thread (Other Libraries?). Whatever, it will be moved if needed.

I see in the PApplet.java code, Processing enforces a minimum applet size of 128x128. So unless you change source and recompile it, you are out of luck.

BTW, if you want to preserve your graph to draw incrementally on it, you can erase the previous text with a simple call to rect() (so you will do a "local background").
Re: text() over text()
Reply #5 - Sep 4th, 2008, 11:22pm
 
GekoCH wrote on Sep 4th, 2008, 11:26am:
With this code

size(200, 50);
background(0);

It doesn't paint all the surface black. Why There is still some space left.

the minimum window size is different for each operating system. we use 128x128 as the default minimum because that works across all three of the platforms that we support.
Re: text() over text()
Reply #6 - Sep 5th, 2008, 6:29am
 
Thx a lot for all the infomration! Great!

Thx
Geko
Page Index Toggle Pages: 1