Hello all,
I was wandering if I could get some advice on how to do some things for this processing sketch
Code:int bloodsugar = 25;
float dayx;
float monthy;
float bsSize;
float bsAlpha;
void setup(){
size (400,400);
noLoop();
}
void draw(){
dayx=map(day(),1,31,0,width);
monthy=map(month(),1,12,0,height);
bsSize = map(bloodsugar,1.0,25.0,10,width/4);
bsAlpha = map(bloodsugar,1.0,25.0,0,255);
fill(255,0,0,bsAlpha);
rect(dayx,monthy,bsSize,bsSize);
}
So what i'd like to do is load in a text file and use the floats contained in it to create the squares and, depending on the amount, 1.0 being low and 25.0 being high adjust the alpha.
The rect x and y is following the day and month using system time, ideally i'd like to contain that information in the text file(i'm assuming) so it would allow for multiple rects.
I really hope i'm making sense, I've been following the the Processing Handbook which is great but the loadStrings doesn't seem to work so any advice on how to go about it and even some sample code would be great.
Thanks,
BeefyC