1

I have 24 buttons that will shape a circle together.

So, the image of the buttons should look in a rotating way like this:

enter image description here

I want to use the same 3 images (setImages(); 3 images for 3 mouseClick conditions in 1 button) in each of them. I thought I could maybe rotate the buttons instead of loading new images.

Is there any way to rotate the buttons? Or could you give me an idea like what would be the most logical way to do this?

Here is my code:

  for(int i=0; i<3; ++i){
    (imgden1[i] = loadImage("den" + i + ".png")).resize(20,20);} //the same 3 images for all the buttons
    
  for(int k=1; k<25; ++k){  //24 buttons in total
    cp5.addButton("Button" + k)  // The button
    .setPosition((50+40*k),140)  //I will set the algorithm for position later when I solve the rotation problem
    .setImages(imgden1)
    .updateSize()
    .setSize(20, 20)       // (width, height)
    .setFont(font)
    .moveTo(AreaRingGroup);
  
    
  }   // add it to the group 
  ; 
Paul Wheeler
  • 18,988
  • 3
  • 28
  • 41
noobie
  • 361
  • 2
  • 9
  • Does this answer your question? [Processing - MouseClick event for an Arc in CP5 Button](https://stackoverflow.com/questions/69178546/processing-mouseclick-event-for-an-arc-in-cp5-button) – Rabbid76 Sep 14 '21 at 14:19
  • This isn't p5.js, it's just processing (no idea why that library author called it p5, that is misleading). Also you don't provided sufficient code to actually test what you are doing. – Paul Wheeler Sep 16 '21 at 03:57

0 Answers0