1

我有 24 个按钮可以一起形成一个圆圈。

所以,按钮的图像应该看起来像这样旋转:

在此处输入图像描述

我想在每个图像中使用相同的 3 个图像(setImages(); 3 个图像,用于 1 个按钮中的 3 个鼠标单击条件)。我想我可以旋转按钮而不是加载新图像。

有没有办法旋转按钮?或者你能给我一个想法,比如最合乎逻辑的方法是什么?

这是我的代码:

  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 
  ; 
4

0 回答 0