hi guys me again, i have recently made a button that when moused over changes texture, the only problem is when i compile the button image is the greenfoot foot symbol until i mouse over the button then it goes back to normal.
how can i make it so when i reset it keeps the 1st image. heres my code:
import greenfoot.*;
public class StartButton extends Actor
{
boolean mouseOver = false;
public void act()
{
if (!mouseOver && Greenfoot.mouseMoved(this))
{
setImage("Button2.png");
mouseOver = true;
}
if (mouseOver && Greenfoot.mouseMoved(null) && ! Greenfoot.mouseMoved(this))
{
setImage("Button1.png");
mouseOver = false;
}
if (Greenfoot.mouseClicked(this))
{
Greenfoot.setWorld(new Marioland());
}
}
}
