processing / processing-android-archive

96 stars 50 forks source link

'Processing & Android: Mobile App Development Made (Very) Easy' on Eclipse ADT need help #55

Closed jcky92 closed 11 years ago

jcky92 commented 11 years ago

Hi,

I had tried using the sample/tutorial given by Jer Thorp and had tried implementing it on Eclipse ADT. I had imported the android-core.jar from the processing 2.0 into the Eclipse Libs folder. However when I copied the sample codes into Eclipse ADT, it highlights the "background(mouseY * (255.0/800), 100, 0);" in the "draw method as below and state that "The method background(int, float) in the type PApplet is not applicable for the arguments (double, int, int)".

public void draw() { //Set the background colour, which gets more red as we move our finger
//down the screen. background(mouseY * (255.0/800), 100, 0); //Chane our box rotation depending on how our finger has moved right-to-left boxRotation += (float) (pmouseX - mouseX)/100;

   //Draw the ball-and-stick
   line(width/2, height/2, mouseX, mouseY);
   ellipse(mouseX, mouseY, 40, 40);

   //Draw the box
   pushMatrix();
     translate(width/2, height/2);
     rotate(boxRotation);
     rect(0,0, 150, 150);
   popMatrix();
 };

And if I change the code from"255.0" to "255" such as "background(mouseY * (255/800), 100, 0);", the emulator can execute the application successfully using Eclipse ADT, however the colouring functionality when I hover around will be lost. Could anyone please help me or teach me how to fix this ?

Thanking you in anticipation.

benfry commented 11 years ago

Please use the forum for questions. This is not a bug report and doesn't belong here.