How to set frame rate

Starting from the BasicGame template, can someone tell me how to set the framerate or set the vsync to true.

I know it’s something like settings.setFrameRate(30); - but I don’t know how to access the settings of BasicGame.

Thanks.

Are you using JME2 or JME3?

settings.setFrameRate is JME3

BasicGame is JME2



in JME3 create your own settings in your main method



AppSettings settings = new AppSettings(true);

settings.setFrameRate(frameRate);

app.setSettings(settings);





I’m not familiar with Jme2 but there seems to be a settings attribute in the basegame class, guess there is a similar method.

1 Like

it’s jme3,

the code worked great thanks!