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 & HelpSyntax Questions › Possible to flip text horizontally
Page Index Toggle Pages: 1
Possible to flip text horizontally? (Read 3028 times)
Possible to flip text horizontally?
Dec 28th, 2009, 8:42am
 
Hy,

I'm wondering, if there is a function to flip text horizontally, directly in processing.



thanks
n

Re: Possible to flip text horizontally?
Reply #1 - Dec 28th, 2009, 8:54am
 
by flipping do you mean to mirror it, or just to rotate it 180° ?
Re: Possible to flip text horizontally?
Reply #2 - Dec 28th, 2009, 8:55am
 
Flipped:

Code:

void setup()
{
 size(200, 200);
 textFont(createFont("Arial", 25));  
}

void draw()
{
 pushMatrix();
 scale(1, -1);
 text("Test", 75, -100);
 popMatrix();
}


Rotated:

Code:

void setup()
{
 size(200, 200);
 textFont(createFont("Arial", 25));  
}

void draw()
{
 pushMatrix();
 translate(125, 100);
 rotate(PI);
 text("Test", 0, 0);
 popMatrix();
}
Re: Possible to flip text horizontally?
Reply #3 - Dec 28th, 2009, 9:01am
 
that would have been my suggesten if you want to mirror it Smiley

if you just want to turn it...
do it like this :

Code:
void setup()
{
size(200, 200);
textFont(createFont("Arial", 25));
}

void draw()
{
translate(width/2,height/2);
pushMatrix();
rotate(PI);
text("Test", 0,0);
popMatrix();
}
Re: Possible to flip text horizontally?
Reply #4 - Dec 28th, 2009, 9:01am
 
damn, faster Smiley
Page Index Toggle Pages: 1