I’m just wondering if there is a way to add/change the default image on a Button. I know how to do it for swing, but what I’m doing uses active rendering and it will probably clash with the EDT. Ty for any help.
Draw an image. When the mouse is over your image, draw another image (hover). When the mouse clicks your image, the button is pressed.
Voila.
if(mouse.X >= image.x && mouse.Y >= image.y && mouse.X <= (image.X + image.width) && mouse.Y <= (image.Y + image.Height)){
image.texture = highlightedTexture;
if(mouse.buttonPressed(button1){
System.exit(0);
}
}else{
image.text = unhighlightedTexture
}
that’s pretty much what you button would be like.
aww man, I was afraid I was going to have to do that… Do you think it will slow the program down if I do it that way?
Where in Phased’s code would even remotely slow the JVM down?! O_o
Stop worrying about performance when you have so little logic and render. You are underestimating the power of the CPU.
EDIT wrong thread facepalm