hello, i am e semiNoob in processing.
now i use the control p5 libary for radiobuttons.
but i have problem with the MOUSE_OVER.
the mouse over appears, but it take the PImage from MODUS:aktive..! why?
all images are different!
..and all images are fine and full loaded.
here is the code.
thx soo mutch for help!!!!!!!!! ;)
- import controlP5.*;
- RadioButton modus;
- void setup() {
- normal1 =loadImage("n01.png"); over1 =loadImage("o01.png"); aktive1 =loadImage("a01.png");
- normal2 =loadImage("n02.png"); over2 =loadImage("o02.png"); aktive2 =loadImage("a02.png");
- normal3 =loadImage("n03.png"); over3 =loadImage("o03.png"); aktive3 =loadImage("a03.png");
- normal4 =loadImage("n04.png"); over4 =loadImage("o04.png"); aktive4 =loadImage("a04.png");
- normal5 =loadImage("n05.png"); over5 =loadImage("o05.png"); aktive5 =loadImage("a05.png");
- normal6 =loadImage("n06.png"); over6 =loadImage("o06.png"); aktive6 =loadImage("a06.png");
- normal7 =loadImage("n07.png"); over7 =loadImage("o07.png"); aktive7 =loadImage("a07.png");
- cp5 = new ControlP5(this);
- modus = cp5.addRadioButton("radioButton",100,490);
- // add a Modus Button
- modus.setItemsPerRow(7);
- modus.setSpacingColumn(34);
- modus.setItemHeight(131);
- modus.setItemWidth(131);
- addToRadioButton1(modus,"01",1);
- addToRadioButton2(modus,"02",2);
- addToRadioButton3(modus,"03",3);
- addToRadioButton4(modus,"04",4);
- addToRadioButton5(modus,"05",5);
- addToRadioButton6(modus,"06",6);
- addToRadioButton7(modus,"07",7);
- modus.activate(2);
- }
- // ------------ ------------ ------------ ------------ ------------ ------------ ------------
- // > MODUS BUTTON | Funtion
- // ------------ ------------ ------------ ------------ ------------ ------------ ------------
- void addToRadioButton1(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal1, over1, aktive1); }
- void addToRadioButton2(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal2, over2, aktive2);}
- void addToRadioButton3(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal3, over3, aktive3);}
- void addToRadioButton4(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal4, over4, aktive4);}
- void addToRadioButton5(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal5, over5, aktive5);}
- void addToRadioButton6(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal6, over6, aktive6);}
- void addToRadioButton7(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName,theValue);
- t.setImages(normal7, over7, aktive7);}
1