Coordinates

edited July 2016 in How To...

I am conducting a transform and a rotation on a piece of text.

pushMatrix();
translate(width/2, height/2);
rotate(radians(270));
text("test",10,20);
popMatrix();

It is printing the text as I want, the question is how do I get the "real" location of the text? I want to check a mouse over and I don't know where it is :)

Thank you in advance.

Answers

  • pushMatrix(); 
    translate(width/2, height/2); 
    rotate(radians(270)); 
    text("test",10,20); 
    textPosX = screenX(10, 20); // global float, match coordinates in text() function
    textPosY = screenY(10, 20); // global float, match coordinates in text() function
    popMatrix();
    
Sign In or Register to comment.