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


Java AppSettings.setUseJoysticks方法代碼示例

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


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

示例1: appSettings

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Singleton
@Provides
public AppSettings appSettings(AppSettingsLoader appSettingsLoader, ResourceBundle resources) {
	AppSettings settings = new AppSettings(true);
	try {
		settings = appSettingsLoader.loadInto(settings);
	} catch (Exception e) {
		e.printStackTrace();
	}
	settings.setTitle(resources.getString("title"));
	settings.setUseJoysticks(true);
	//settings.setGammaCorrection(true); //TODO jme 3.1.0
	//settings.setResolution(640,480);
	//	settings.setRenderer("JOGL");
	//	settings.setRenderer(AppSettings.LWJGL_OPENGL3);
	return settings;
}
 
開發者ID:davidB,項目名稱:jme3_skel,代碼行數:18,代碼來源:MainModule.java

示例2: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) { 
   AppSettings settings = new AppSettings(false);
    settings.setTitle("SkyHussars");
    settings.setUseJoysticks(true);
    
    /* TODO: make it moddable */
    settings.setSettingsDialogImage("images/settings_image.jpg");
    SkyHussars application = new SkyHussars();
    application.setSettings(settings);
    application.start();

}
 
開發者ID:ZoltanTheHun,項目名稱:SkyHussars,代碼行數:13,代碼來源:SkyHussars.java

示例3: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args){
    TestJoystick app = new TestJoystick();
    AppSettings settings = new AppSettings(true);
    settings.setUseJoysticks(true);
    app.setSettings(settings);
    app.start();
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:8,代碼來源:TestJoystick.java

示例4: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) {
	GrassTest app = new GrassTest();
	app.getStateManager().detach(app.getStateManager().getState(FlyCamAppState.class));
	AppSettings settings = new AppSettings(true);
	settings.setUseJoysticks(true);
	settings.setResolution(1280, 800);
	settings.setVSync(true);
	app.setSettings(settings);
	app.setShowSettings(true);
	app.start();
}
 
開發者ID:shamanDevel,項目名稱:ProceduralTerrain,代碼行數:12,代碼來源:GrassTest.java

示例5: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args){
    TestJoystickExt app = new TestJoystickExt();
    AppSettings settings = new AppSettings(true);
    settings.setUseJoysticks(true);
    app.setSettings(settings);
    app.start();
}
 
開發者ID:shamanDevel,項目名稱:ProceduralTerrain,代碼行數:8,代碼來源:TestJoystickExt.java

示例6: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
  public static void main(String[] args) {
//load save
File root = new File("./saves/");
JFileChooser chooser = new JFileChooser(root);
chooser.addChoosableFileFilter(new FileNameExtensionFilter(null, "save"));
chooser.setFileFilter(new FileNameExtensionFilter(null, "save"));
int result = chooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION) {
	try (ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(chooser.getSelectedFile())))) {
		loadedStep = (Class<? extends AbstractTerrainStep>) in.readObject();
		loadedProperties = (Map<Object, Object>) in.readObject();
	} catch (Exception ex) {
		LOG.log(Level.SEVERE, "unable to load save file", ex);
	}
}

Logger rootLogger = Logger.getLogger("");
for (Handler h : rootLogger.getHandlers()) {
	if (h instanceof ConsoleHandler) {
		((ConsoleHandler) h).setFormatter(new JmeFormatter());
	}
}

//create app
      TerrainHeighmapCreator app = new TerrainHeighmapCreator();
app.getStateManager().detach(app.getStateManager().getState(FlyCamAppState.class));
AppSettings settings = new AppSettings(true);
settings.setUseJoysticks(true);
settings.setResolution(1280, 800);
settings.setVSync(true);
if (RECORDING_TIMER) {
	settings.setFrameRate(30);
}
app.setSettings(settings);
app.setShowSettings(true);
if (RECORDING_TIMER) {
	app.setTimer(new VideoRecorderAppState.IsoTimer(30));
}
      app.start();
  }
 
開發者ID:shamanDevel,項目名稱:ProceduralTerrain,代碼行數:42,代碼來源:TerrainHeighmapCreator.java

示例7: onCreate

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    initializeLogHandler();
    JmeSystem.setSystemDelegate(new JmeAndroidCardboardSystem());
    logger.fine("onCreate");
    super.onCreate(savedInstanceState);

    if (screenFullScreen) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        if (!screenShowTitle) {
            requestWindowFeature(Window.FEATURE_NO_TITLE);
        }
    }

    final DataObject data = (DataObject) getLastNonConfigurationInstance();
    if (data != null) {
        logger.log(Level.FINE, "Using Retained App");
        this.app = data.app;
    } else {
        // Discover the screen reolution
        //TODO try to find a better way to get a hand on the resolution
        WindowManager wind = this.getWindowManager();
        Display disp = wind.getDefaultDisplay();
        
        
        DisplayMetrics displaymetrics = new DisplayMetrics();
        getWindow().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
        Log.d("CardboardHarness", "Resolution from Window, width:" + displaymetrics.widthPixels + ", height: " + displaymetrics.heightPixels);
        // Create Settings
        logger.log(Level.FINE, "Creating settings");
        AppSettings settings = new AppSettings(true);
        settings.setEmulateMouse(mouseEventsEnabled);
        settings.setEmulateMouseFlipAxis(mouseEventsInvertX, mouseEventsInvertY);
        settings.setUseJoysticks(joystickEventsEnabled);
        settings.setEmulateKeyboard(keyEventsEnabled);

        settings.setBitsPerPixel(eglBitsPerPixel);
        settings.setAlphaBits(eglAlphaBits);
        settings.setDepthBits(eglDepthBits);
        settings.setSamples(eglSamples);
        settings.setStencilBits(eglStencilBits);

        settings.setResolution(displaymetrics.widthPixels, displaymetrics.heightPixels);
        settings.setAudioRenderer(audioRendererType);

        settings.setFrameRate(frameRate);

        // Create application instance
        try {
            if (app == null) {
                @SuppressWarnings("unchecked")
                Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass);
                app = clazz.newInstance();
            }

            app.setSettings(settings);
            app.start();
        } catch (Exception ex) {
            handleError("Class " + appClass + " init failed", ex);
            setContentView(new TextView(this));
        }
    }

    ctx = (CardboardContext) app.getContext();
    view = ctx.createView(this);
    // AndroidHarness wraps the app as a SystemListener.
    ctx.setSystemListener(this);
    layoutDisplay();
    
    vrAppState = new CardboardState(ctx);
    (getJmeApplication()).getStateManager().attach(vrAppState);
}
 
開發者ID:neph1,項目名稱:jme-cardboard,代碼行數:76,代碼來源:CardboardHarness.java


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