Hello !
so , i want to make a vehicle selector like this one in my Game Client , but simpler :
So, is there a Simple Way to start any game from a jfx Canvas or awt Canvas inside JFrame or a Stage containing other widgets(buttons,comboboxes,etc), i want to step aside from using OpenGL .
i have found this example but it didnot work for me using awt Canvas on a JFrame !
the example :
public static void createCanvas(String appClass){
AppSettings settings = new AppSettings(true);
settings.setWidth(640);
settings.setHeight(480);
try{
Class clazz = Class.forName(appClass);
app = (LegacyApplication)clazz.newInstance();
}catch (ClassNotFoundException ex){
ex.printStackTrace();
}catch (InstantiationException ex){
ex.printStackTrace();
}catch (IllegalAccessException ex){
ex.printStackTrace();
}
app.setPauseOnLostFocus(false);
app.setSettings(settings);
app.createCanvas();
app.startCanvas();
context = (JmeCanvasContext) app.getContext();
canvas = context.getCanvas();
canvas.setSize(settings.getWidth(), settings.getHeight());
}
thank you.