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


Java SimpleApplication.getStateManager方法代碼示例

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


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

示例1: createScene

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
static private boolean createScene(SimpleApplication app, EntityData ed) {
	// RendererPlatform.setApp(app);
	app.getViewPort().addProcessor(new FilterPostProcessor(app.getAssetManager()));

	AppStateManager stateManager = app.getStateManager();

	stateManager.attach(new DataState(EditorPlatform.getEntityData()));
	stateManager.attach(new SceneSelectorState());

	return true;
}
 
開發者ID:meltzow,項目名稱:supernovae,代碼行數:12,代碼來源:LoadingGameController.java

示例2: keyPressed

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
static private void keyPressed(SimpleApplication app, KeyEvent keyevent) {
	AppStateManager stateManager = app.getStateManager();
	EntityData enData = stateManager.getState(DataState.class).getEntityData();
	EntityId player1 = enData.findEntity(new NamingFinder(WorldProc.PLAYER1_NAME), Naming.class);
	KeyboardInput keyboardInput = new KeyboardInput(keyevent.getCode());
	enData.setComponent(player1,keyboardInput);

}
 
開發者ID:meltzow,項目名稱:supernovae,代碼行數:9,代碼來源:GameInputListener.java

示例3: setSceneMouseCoord

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
static private boolean setSceneMouseCoord(SimpleApplication app, Point2D coord) {
	AppStateManager stateManager = app.getStateManager();
	stateManager.getState(SceneSelectorState.class).setCoordInScreenSpace(coord);
	return true;
}
 
開發者ID:meltzow,項目名稱:supernovae,代碼行數:6,代碼來源:WorldEditorInputListener.java

示例4: setAction

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
static private boolean setAction(SimpleApplication app, ActionType type) {

		AppStateManager stateManager = app.getStateManager();
		EntityData enData = stateManager.getState(DataState.class).getEntityData();

		Point2D selectedPoint = stateManager.getState(SceneSelectorState.class).getPointedCoordInPlan();
		EntityId player1 = enData.findEntity(new NamingFinder(WorldProc.PLAYER1_NAME), Naming.class);
		MouseInput input;
		switch (type) {
			case StartPrimary:
				break;
			case StartSecondary:
				break;
			case OncePrimary:
				input = new MouseInput(ActionType.OncePrimary,selectedPoint);
				enData.setComponent(player1,input);
				break;
			case OnceSecondary:
				input = new MouseInput(ActionType.OnceSecondary,selectedPoint);
				enData.setComponent(player1,input);
				break;
			case DoublePrimary:
				input = new MouseInput(ActionType.DoublePrimary,selectedPoint);
				enData.setComponent(player1,input);
			case ScrollIn:
				input = new MouseInput(ActionType.ScrollIn, selectedPoint);
				enData.setComponent(player1, input);
				break;
			case ScrollOut:
				input = new MouseInput(ActionType.ScrollOut, selectedPoint);
				enData.setComponent(player1, input);
				break;
			case DRAG:
				input = new MouseInput(ActionType.DRAG, selectedPoint);
				enData.setComponent(player1, input);
				break;
			default:
				break;
		}
		return true;
	}
 
開發者ID:meltzow,項目名稱:supernovae,代碼行數:42,代碼來源:GameInputListener.java

示例5: initialize

import com.jme3.app.SimpleApplication; //導入方法依賴的package包/類
@Override
public void initialize(AppStateManager stateManager, Application app)
{
    super.initialize(stateManager, app);
    
    initialTime = System.currentTimeMillis();
    
    simpleApp = (SimpleApplication) app;
    
    this.stateManager = simpleApp.getStateManager();
    this.assetManager = simpleApp.getAssetManager();
    this.camera = simpleApp.getCamera();
    this.flyCam = simpleApp.getFlyByCamera();
    this.inputManager = simpleApp.getInputManager();
    this.rootNode = simpleApp.getRootNode();
    this.guiNode = simpleApp.getGuiNode();
    this.viewPort = simpleApp.getViewPort();
    
    Music.setAssetManager(assetManager);
    
    showTitle();

    setCamPosition();
 
    initCave();
    
    initAtmosphere(); 
    
    initFloorLighting();
    
    initFadeFilter();
    
    initKeyboardControls();
    
    Music.playIntroTheme();
    
    spiders = new LinkedList<>();
}
 
開發者ID:abnercoimbre,項目名稱:tower-defense-cave,代碼行數:39,代碼來源:StartScreenAppState.java


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