hi, trying to increase the brightness of circle as you drag it upwards(going from black at bottom to white at top). I've put a conditional for this in void display method. Any help?
Button[] buttons = new Button[1]; boolean somethingSelected = false;
void setup() { size(800, 300); smooth(); for (int i = 0; i < buttons.length; i++) { buttons[i]= new Button(width/2, 250, random(20, 80), color(0), 0.5); } }
void draw() { background(85); for (int i = 0; i < buttons.length; i++) { buttons[i].display(); } }
void mousePressed() { somethingSelected = false; for (int i = 0; i < buttons.length; i++) { buttons[i].rollOver(); buttons[i].doubleclick(); buttons[i].originalSize(); } } void mouseDragged() { for (int i = 0; i < buttons.length; i++) buttons[i].bDragged(); }
void mouseReleased() { for (int i = 0; i < buttons.length; i++) buttons[i].bReleased(); }
click ellipse once it turns from blue to red; how can i make it so another click makes it go back to blue again? (sorry, insert code function not working...)
Button buttons;
Button buttons1;
void setup() {
size(500, 500);
smooth();
buttons= new Button(50, 100, random (20, 80), color(0, 0, 255));
buttons1= new Button(80, 180, random (20, 80), color(0, 0, 255));
}
void draw() {
buttons.display();
buttons1.display();
buttons.rollOver();
buttons1.rollOver();
}
class Button {
float x;
float y;
float radius;
color c;
boolean click=false;
moving an object in a rectangle is easy as it uses x and y axis for mouse position. How do you move a shape within an ellipse or arc (i.e. moving hands on a clock or segments within a pie chart etc)?
i want to be able to move elllipse and then when i right click be able to control its size (while keeping it in its current position). i have tried to do this; moving ellipse round screen is fine, but how do i then change ellipse size without moving its position? Help me?........