Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
codeduder
codeduder's Profile
4
Posts
6
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
how to detect mouse move direction?
[10 Replies]
09-Aug-2010 12:43 PM
Forum:
Programming Questions
is it possible to detect the mouse move direction? (like form left to right, or right to left)
i guess maybe there is something with:
float dir = dist(mouseX, mouseY, pmouseX, pmouseY);
thanks
basic object question
[4 Replies]
06-Aug-2010 03:34 AM
Forum:
Programming Questions
i used to programm in flash, and i am new to processing.
my main-understanding-question in processing is:
if i create objects to the stage, how can i call them? (like instances)
for example i have a array of objects like this:
int numSpots = 10;
Spot[] spots = new Spot[numSpots];
void setup() {
size(450,150);
smooth();
background(0);
for (int i = 0; i < spots.length; i++) {
float x = (40 + 5)*i;
spots[i] = new Spot(x);
}
}
class Spot {
float x;
Spot(float xpos) {
x = xpos;
fill(255,10);
rect(x, 0, 40, 150);
}
}
now as an example i like to do a MouseRollover, and print the objects instance ( the "i" nr) by rollover an object.
like this:
print("im over" + i);
fadeOut class
[2 Replies]
27-Jul-2010 04:36 AM
Forum:
Programming Questions
i try do make a simple fadeOut Class, but with my sketch it goes to fast!
how i can add a fade-speed-parameter to my class to control the fadeSpeed?
FadeOut spot;
void setup() {
size(500,500);
background(2);
spot = new FadeOut();
frameRate(1);
}
class FadeOut {
FadeOut() {
background(120, 0);
for(int i=255;i>0;i--) {
fill(255, 255, 255, i);
print(i);
}
rect(125, 125, 250,250);
}
}
midi keyboard / noteOn & noteOff: shape fade out
[2 Replies]
17-Jul-2010 08:30 AM
Forum:
Programming Questions
i draw with the midi keyboard shapes like this:
void noteOn(Note note, int device, int channel){
int vel = note.getVelocity();
int pit = note.getPitch();
println(pit);
fill(255, _alpha);
rect((pit-48)*40, 0, 40, 150);
}
now i would like to do a alpha-fade for out by the noteOff-Event
void noteOff(Note note, int device, int channel){
int pit = note.getPitch();
fill(255, 0);
}
logically this script does not work
how i have to work out this? (maybe with OOP?)
«Prev
Next »
Moderate user : codeduder
Forum