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.
Page Index Toggle Pages: 1
Rotate text (Read 1427 times)
Rotate text
Jun 26th, 2009, 7:37pm
 
Hi, new to Processing and learning some of the things I took for granted with Flash are not as simple without a GUI. Just spent an hour stuck on this so I thought I would share...

PS. Had to uncheck add to favorites because I kept getting an error message (died at favorites.pl)

Here's my code.


Code:





// Base rotation
float rot = 0;

void setup()
{
 size (600,600);
 // Load font from data folder
 PFont font;
 font = loadFont("Verdana-11.vlw");
 textFont(font);
}


void draw()
{
 background(255);
 fill(0);
 
 translate(width/2, height/2);
 // Rotate
 rotate(rot);

 // Extra shape for display
 rect(20,20,200,20);
 
 textAlign(LEFT, CENTER);
 text("N Meridian Rd", 100, 105);
}

void mouseClicked()
{
rot+=PI/2;
}




Re: Rotate text
Reply #1 - Jun 27th, 2009, 6:03am
 
Thanks for sharing, these questions of rotation are always delicate to solve.
Perhaps the Program section would have been a better place, since that's not a syntax question.

BTW, I see you posted your message multiple times, probably a glitch of the forum. Might I suggest you to go to each extra message and delete them, please? It would lighten the forum, avoid dispersion and save some time for moderators... Smiley Thanks!
Re: Rotate text
Reply #2 - Jun 27th, 2009, 2:11pm
 
Thanks Phil, I deleted them. Is there a way to move a topic?
Re: Rotate text
Reply #3 - Jun 28th, 2009, 12:41am
 
Thanks.
And no, I fear we cannot move a topic ourselves, moderators do that when they feel it is really necessary.
Not a big problem in your case. This forum has become a catch all section anyway.
Page Index Toggle Pages: 1