當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleApplication.setDisplayFps方法代碼示例

本文整理匯總了Java中com.jme3.app.SimpleApplication.setDisplayFps方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleApplication.setDisplayFps方法的具體用法?Java SimpleApplication.setDisplayFps怎麽用?Java SimpleApplication.setDisplayFps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jme3.app.SimpleApplication的用法示例。


在下文中一共展示了SimpleApplication.setDisplayFps方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: simpleApplication

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
@Singleton
@Provides
public SimpleApplication simpleApplication(AppSettings appSettings) {
	//HACK
	final CountDownLatch initializedSignal = new CountDownLatch(1);
	SimpleApplication app = new SimpleApplication(){
		@Override
		public void simpleInitApp() {
			initializedSignal.countDown();
		}

		@Override
		public void destroy() {
			super.destroy();
			FxPlatformExecutor.runOnFxApplication(() -> {
				Platform.exit();
			});
		}
	};
	app.setSettings(appSettings);
	app.setShowSettings(false);
	app.setDisplayStatView(false);
	app.setDisplayFps(false);
	app.start();
	try {
		initializedSignal.await();
	} catch (InterruptedException e) {
		e.printStackTrace();
	}
	return app;
}
 
開發者ID:davidB,項目名稱:jme3_skel,代碼行數:32,代碼來源:MainModule.java

示例2: apply

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
void apply(SimpleApplication app) {
		try {
			app.setDisplayFps(showFps.isSelected());
			app.setDisplayStatView(showStats.isSelected());
			app.setShowSettings(true);
	    	AppSettings settingsEdit = new AppSettings(false);
	    	settingsEdit.copyFrom(app.getContext().getSettings());
	    	settingsEdit.setFullscreen(fullscreen.isSelected());
	    	settingsEdit.setVSync(vsync.isSelected());
	    	DisplayMode mode = resolution.getValue();
	    	settingsEdit.setResolution(mode.getWidth(), mode.getHeight());
	    	settingsEdit.setDepthBits(mode.getBitDepth());
	    	settingsEdit.setFrequency(!vsync.isSelected() ? 0 : (mode.getRefreshRate() != DisplayMode.REFRESH_RATE_UNKNOWN)? mode.getRefreshRate() : 60);
	    	settingsEdit.setSamples(antialiasing.getValue());
	    	app.setSettings(settingsEdit);
	    	settingsEdit.save(settingsEdit.getTitle());
	    	app.restart();
//	    	((Main)app).onNextReshape = new Function<Main,Boolean>(){
//				@Override
//				public Boolean apply(Main input) {
//		    		Widgets.fullCamera(hudPanel, input.getCamera());
//		    		return true;
//				}
//
//	    	};
		} catch(Exception exc) {
			throw new RuntimeException(exc);
		}
    }
 
開發者ID:davidB,項目名稱:jme3_skel,代碼行數:30,代碼來源:HudSettings.java

示例3: 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;
		});
	}
 
開發者ID:davidB,項目名稱:jme3_ext_spatial_explorer,代碼行數:60,代碼來源:Demo.java

示例4: 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);
	}
 
開發者ID:xbuf,項目名稱:jme3_xbuf,代碼行數:45,代碼來源:ModelViewer.java


注:本文中的com.jme3.app.SimpleApplication.setDisplayFps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。