本文整理匯總了Java中com.jme3.app.SimpleApplication.setPauseOnLostFocus方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleApplication.setPauseOnLostFocus方法的具體用法?Java SimpleApplication.setPauseOnLostFocus怎麽用?Java SimpleApplication.setPauseOnLostFocus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.app.SimpleApplication
的用法示例。
在下文中一共展示了SimpleApplication.setPauseOnLostFocus方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initApp
import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
public static void initApp(SimpleApplication simpleapp) {
loadTestData(simpleapp.getAssetManager());
simpleapp.getFlyByCamera().setMoveSpeed(200f);
simpleapp.setPauseOnLostFocus(false);
BulletAppState bullet=new BulletAppState();
bullet.setThreadingType(ThreadingType.PARALLEL);
simpleapp.getStateManager().attach(bullet);
}
示例2: main
import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
Logger.getLogger("").setLevel(Level.WARNING);
AppSettings settings = new AppSettings(true);
settings.setResolution(1280, 720);
settings.setVSync(true);
settings.setFullscreen(false);
SimpleApplication app = new SimpleApplication(){
@Override
public void simpleInitApp() {
}
};
app.setSettings(settings);
app.setShowSettings(false);
app.setDisplayStatView(true);
app.setDisplayFps(true);
// !!!! without .setPauseOnLostFocus(false)you should switch focus from javafx window to jme to see update
app.setPauseOnLostFocus(false);
app.start();
//Setup Camera
app.enqueue(() -> {
app.getFlyByCamera().setEnabled(true);
app.getFlyByCamera().setDragToRotate(true);
//app.getStateManager().detach(app.getStateManager().getState(FlyCamAppState.class));
app.getInputManager().setCursorVisible(true);
return null;
});
//Setup a default scene (grid + axis)
app.enqueue(() -> {
app.getRootNode().attachChild(Helper.makeScene(app));
app.getRootNode().attachChild(sampleCube(app));
app.getRootNode().attachChild(sampleShapes(app));
return null;
});
//Setup SpatialExplorer
Helper.setupSpatialExplorerWithAll(app);
// app.enqueue(() -> {
// AppStateSpatialExplorer se = new AppStateSpatialExplorer();
// Helper.registerAction_Refresh(se.spatialExplorer);
// Helper.registerAction_ShowLocalAxis(se.spatialExplorer, app);
// Helper.registerAction_SaveAsJ3O(se.spatialExplorer, app);
// Helper.registerAction_ShowSkeleton(se.spatialExplorer, app);
// Helper.registerAction_ShowWireframe(se.spatialExplorer, app);
// Helper.registerBarAction_ShowFps(se.spatialExplorer, app);
// Helper.registerBarAction_ShowStats(se.spatialExplorer, app);
// Helper.registerBarAction_SceneInWireframe(se.spatialExplorer, app);
// Helper.registerBarAction_SceneInDebugPhysic(se.spatialExplorer, app);
// app.getStateManager().attach(se);
// return null;
// });
app.enqueue(() -> {
AppStateSpatialExplorer se = app.getStateManager().getState(AppStateSpatialExplorer.class);
registerBarAction_PrintToto(se.spatialExplorer);
return null;
});
}
示例3: ModelViewer
import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
public ModelViewer(Options options) {
this.options = options;
AppSettings settings = new AppSettings(true);
settings.setResolution(options.width, options.height);
settings.setVSync(true);
settings.setFullscreen(options.fullscreen);
// try {
// ClassLoader cl = Thread.currentThread().getContextClassLoader();
// settings.setIcons(new BufferedImage[]{
// ImageIO.read(cl.getResourceAsStream("shortcut-128.png")),
// ImageIO.read(cl.getResourceAsStream("shortcut-64.png")),
// ImageIO.read(cl.getResourceAsStream("shortcut-32.png")),
// ImageIO.read(cl.getResourceAsStream("shortcut-16.png"))
// });
// } catch (Exception e) {
// //log.log(java.util.logging.Level.WARNING, "Unable to load program icons", e);
// e.printStackTrace();
// }
if (options.assetCfg != null) {
settings.putString("AssetConfigURL", options.assetCfg.toExternalForm());
}
app = new SimpleApplication(){
CountDownLatch running = new CountDownLatch(1);
@Override public void simpleInitApp() {
}
@Override public void destroy() {
super.destroy();
running.countDown();
}
};
app.setSettings(settings);
app.setShowSettings(options.showJmeSettings);
app.setDisplayStatView(true);
app.setDisplayFps(true);
// !!!! without .setPauseOnLostFocus(false) server will only send screenshot to blender,... when jme main screen have focus
app.setPauseOnLostFocus(false);
}