GUI for a Game. FenGUI?

Hi there.



I selected FenGui for our project.



I

Just create your own Widgets…




import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.fenggui.Widget;
import org.fenggui.event.mouse.MouseEnteredEvent;
import org.fenggui.event.mouse.MouseExitedEvent;
import org.fenggui.event.mouse.MousePressedEvent;
import org.fenggui.render.Binding;
import org.fenggui.render.Graphics;
import org.fenggui.render.Pixmap;



public class MyWidget extends Widget {

    protected int mouseX = 0,  mouseY = 0;
    protected static Pixmap widgetBackground = null;
    protected boolean useBackground = true;

   
    public MyWidget() {
            String textureLocation = "Widget_Background.png";
           
        try{
            widgetBackground = new Pixmap( Binding.getInstance().getTexture( textureLocation ) );
        } catch( IOException ex ){
            Logger.getLogger( MyWidget.class.getName() ).log( Level.SEVERE, null, ex );
        }
    }

    @Override
    public void paint( Graphics g ) {

        if( useBackground ){
            g.drawScaledImage( widgetBackground, 0, 0, getWidth(), getHeight() );
        }
    }

    @Override
    public void mousePressed( MousePressedEvent mp ) {
        mouseX = mp.getDisplayX() - this.getDisplayX();
        mouseY = mp.getDisplayY() - this.getDisplayY();
    }

    @Override
    public void mouseEntered( MouseEnteredEvent mouseEnteredEvent ) {
    }

    @Override
    public void mouseExited( MouseExitedEvent mouseExitedEvent ) {
    }
}

You can just add the widgets to a container. Also, look at the game menu example that comes with FengGUI, it think that will answer many of your questions.