is it possible to give different links to every moving shape in my program? i have 10 different shapes in screen and every shape has different web link. is it possible?
i know maybe i ask too much but i should really know where my problem is.. my firends and teachers in my university have no idea what processing is.. maybe they heard about it, but they cant be helpful.
so; my code was only one bubble, now there are many. and i wrote a void collision() but it seems it doesnt effective.
i'm sure that my void collision() is true, and i dont see any fail messages. i saw a collision example, and i just want my bubbles have the same collision effect. am i missing something?
here is my code:
int numBlob = 15;
float spring = 0.005;
float gravity = 0.0003;
float friction = -0.9;
Blob[] blobs = new Blob[numBlob];
void setup()
{
size(1000, 600);
stroke(0);
smooth();
//noStroke();
frameRate(320);
for(int i = 0; i < numBlob; i++)
{
blobs[i] = new Blob(25,random(10,70),50,50,random(10, 90),i,blobs);
}
/*blobs[0] = new Blob(41,52,6,22,random(20, 40),blobs);
i try to create class, so i can have 5 floating shapes. but it doesnt work. please help, thanks
edit:
in my code i'm having "Component.x is not visible" error. i can create only one floating shape but when i want to have 5, i should use class, right? i read some examples and tried to create Bubble class. my bubble has 3 different options: movement(bouncing around the walls) , display(bubble's size and color etc) and segg(how many segments bubble has).
i have coded for only one bubble without segments and movement. and it was moving only on y position. i have to learn it :) sorry for my unclearly message
Bubble b1;
Bubble b2;
Bubble b3;
Bubble b4;
Bubble b5;
float ci_x = noise(10)*0.5;
float ci_y = noise(10)*0.5;
float move_x = noise(1);
float move_y = noise(1);
float currentx;
float currenty;
float num = 2;
void setup(){
size(600,600);
frameRate(320);
b1 = new Bubble(50,100,100,40,10);
b2 = new Bubble(50,100,100,60,30);
b3 = new Bubble(50,100,100,10,50);
b4 = new Bubble(50,100,100,80,70);
b5 = new Bubble(50,100,100,6,100);
}
void draw(){
background(0);
b1.move();
b1.display();
b1.segg();
b2.move();
b2.display();
b2.segg();
b3.move();
b3.display();
b3.segg();
b4.move();
b4.display();
b4.segg();
b5.move();
b5.display();
b5.segg();
}
class Bubble {
color c;
float pozX;
float pozY;
int Segments;
int ssize;
Bubble(color b_color, float xpoz, float ypoz, int seg, int sizee){
i have a question. i have a tag cloud with floating bubbles in it.and i have database with some labels and values. is it possible to set the bubble size with label value? i mean a bubble's size will be the value of label. and writing the label in bubble? any ideas please?
i have a code that i developed a little bit. my goal is making a tag cloud with bubbles, which are floating on screen and when they touch each other, changing the floating direction. when i try to add another bubble on screen, my first bubbles gains more speed. and second bubble doesnt floating in screen. i try to have 5 or more bubbles on screen and they floating to random directions..sorry for my bad english.
float ne_x = noise(10)*0.5;
float ne_y = noise(10)*0.5;
float move_x = noise(1);
float move_y = noise(1);
float currentx;
float currenty;
float num = 2;
void setup(){
size(700, 400);
//stroke(#D60DFF);
smooth();
noStroke();
//strokeWeight(3);
currentx = width / 2;
currenty = height / 2;
frameRate(320);
}
void draw(){
fill(113,25,10,6);
// background(#C95F45);
rect(0, 0, width, height);
drw(ne_x, ne_y, 30, 30);
}
void drw(float pozX, float pozY, int seg, int bub_we) {