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
if (key == i) { (Read 520 times)
if (key == i) {
Jan 21st, 2010, 10:40am
 
Is something like this possible:
     if (key == i) {

Code:

int scaleX = 0;

void scaleCheck(){
if(keyPressed) {
for(int i = 1; i < 10; i++){
if (key == i) {
scaleX = i;
}
}
}
scale(scaleX);
}
Re: if (key == i) {
Reply #1 - Jan 21st, 2010, 10:50am
 
Code:
void scaleCheck(){
if(keyPressed) {
if (key >= '1' && key <= '9') {
scaleX = int(key) - int('0');
scale(scaleX);
}
}
}
Re: if (key == i) {
Reply #2 - Jan 21st, 2010, 11:54am
 
thx!
Page Index Toggle Pages: 1