textWidth() strange behaviour...
in
Programming Questions
•
2 years ago
Well..I have a very strange problem...I'm working on a big project with Processing, and I need to know the Width of a simple text that appears on a popup...the strange thing is this:
1. the textWidth(string) in the Setup section gives me 96
2. the textWidth(string) in the Draw section gives me 100
3. the textWidth(string) called when the popup appears gives me 100 the first time and 109 the second time and the third,...
I'm sorry but I have no Idea why this happens...and, of course, the string is always the same! Do you have any idea why textWidth() is acting like this ?
Thank you guys =3
PS = I tried point 1 and 2 even if they are actually useless just trying to know where the problem was..
1. the textWidth(string) in the Setup section gives me 96
2. the textWidth(string) in the Draw section gives me 100
3. the textWidth(string) called when the popup appears gives me 100 the first time and 109 the second time and the third,...
I'm sorry but I have no Idea why this happens...and, of course, the string is always the same! Do you have any idea why textWidth() is acting like this ?
Thank you guys =3
PS = I tried point 1 and 2 even if they are actually useless just trying to know where the problem was..
1