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


Java InputMultiplexer.addProcessor方法代碼示例

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


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

示例1: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void show() {
    bg = ResKeeper.get(TextureId.BG);
    InputMultiplexer im = new InputMultiplexer(stage);
    im.addProcessor(new HardInputProcessor() {
        @Override
        public boolean keyUp(int keycode) {
            if (keycode == Keys.BACKSPACE || keycode == Keys.BACK) {
                dispose();
                Gdx.app.exit();
            }
            return false;
        }
    });
    Gdx.input.setInputProcessor(im);
    Gdx.input.setCatchBackKey(true);
}
 
開發者ID:NaikSoftware,項目名稱:SaveUA,代碼行數:18,代碼來源:GdxMenu.java

示例2: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void show() {
    stage = new Stage(new StretchViewport(Width,Height));
    stage.addActor(tabContinue);
    PerspectiveCamera camera2 = new PerspectiveCamera(40, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    camera2.position.set(0, -Width * 0.075f, Width * 0.135f);
    camera2.lookAt(0, 0, 0);
    camera2.far = Width*0.3f;
    camera2.near = 1;
    camera2.update();
    controller = new CameraInputController(camera2);
    CameraGroupStrategy cameraGroupStrategy = new CameraGroupStrategy(camera2);
    batch = new DecalBatch(cameraGroupStrategy);
    modelBatch = new ModelBatch();
    InputMultiplexer in = new InputMultiplexer();
    in.addProcessor(stage);
    in.addProcessor(controller);
    Gdx.input.setInputProcessor(in);
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:20,代碼來源:ScreenBricks.java

示例3: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void show() {
    if(drawone){
        addBackgroundExtension();
        addPuls();
        addimagebg();
        addButtonBottom();
        drawone = false;
    }
    cameraGroupStrategy = new CameraGroupStrategy(camera);
    batch = new DecalBatch(cameraGroupStrategy);
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
    addtostage();
    Gdx.input.setCatchBackKey(true);
    inputmulti = new InputMultiplexer();
    inputmulti.addProcessor(stage);
    Gdx.input.setInputProcessor(inputmulti);
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:19,代碼來源:ScreenExtensions.java

示例4: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
    public void show() {
        if(drawone){
            addroomselect();
            addButtonBottom();
            addPuls();
            addimagebg();
            addbuildRoom();
            addtimerbuildroom();
            drawone = false;
        }
        cameraGroupStrategy = new CameraGroupStrategy(camera);
//        CameraInputController controller = new CameraInputController(camera);
        stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
        batchsprite = new SpriteBatch();
        addtostage();
        batch = new DecalBatch(this.cameraGroupStrategy);
        Gdx.input.setCatchBackKey(true);
        InputMultiplexer inputmulti = new InputMultiplexer();
        inputmulti.addProcessor(stage);
        Gdx.input.setInputProcessor(inputmulti);
    }
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:23,代碼來源:ScreenRooms.java

示例5: PlayState

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
public PlayState(GameStateManager gsm) {
	super(gsm);
	Assets.loadGameStageAssets();
	Engine ashleyEngine = new Engine();
	LevelManager.loadLevel("maps/simple-map.tmx");
	_renderer = new OrthogonalTiledMapRenderer(LevelManager.tiledMap);
	_gameCamera = new OrthographicCamera();
	EntityFactory entityFactory = new EntityFactory(ashleyEngine);
	InputHandler inputhandler = new InputHandler(_gameCamera,entityFactory,gsm,ashleyEngine);
	_uiStage = new UiStage();
	_entityManager = new EntityManager(ashleyEngine, _batch, _gameCamera, inputhandler, _uiStage, gsm, entityFactory);

	InputMultiplexer multi = new InputMultiplexer();

	multi.addProcessor(_uiStage);
	multi.addProcessor(inputhandler);
	Gdx.input.setInputProcessor(multi);
}
 
開發者ID:JoakimRW,項目名稱:ExamensArbeteTD,代碼行數:19,代碼來源:PlayState.java

示例6: CreateStage

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
private void CreateStage(float w, float h, float scale) {
	if(stage!=null) stage.dispose();

	stage = new Stage();
	addMetallicSlider(w,h,scale);
	addRougnessSlider(w,h,scale);
	addAlbedoRSlider(w,h,scale);
	addAlbedoGSlider(w,h,scale);
	addAlbedoBSlider(w,h,scale);
	addOcclusionlider(w,h,scale);
	addTypeButton(w,h,scale);

	InputMultiplexer multiplexer = new InputMultiplexer();
	multiplexer.addProcessor(stage);
	multiplexer.addProcessor(camController);

	Gdx.input.setInputProcessor(multiplexer);
}
 
開發者ID:PWorlds,項目名稱:LibGDX-PBR,代碼行數:19,代碼來源:PBRTestAPP.java

示例7: init

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
private void init() {
    camera = new OrthographicCamera(Constants.VIEWPORT_WIDTH, Constants.VIEWPORT_HEIGHT);
    camera.position.set(0, 0, 0);
    camera.update();

    isGameOver = false;
    player = new Role("lante");
    mapMgr = new MapsManager(player);

    hudCamera = new OrthographicCamera();
    hudCamera.setToOrtho(false, Constants.VIEWPORT_WIDTH, Constants.VIEWPORT_HEIGHT);//physical world
    hudCamera.update();
    hudScreen = new HUDScreen(this, player);
    multiplexer = new InputMultiplexer();
    multiplexer.addProcessor(hudScreen.getStage());
    multiplexer.addProcessor(this);
    input.setInputProcessor(multiplexer);
}
 
開發者ID:Mignet,項目名稱:Inspiration,代碼行數:19,代碼來源:WorldController.java

示例8: GameScreen

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
public GameScreen() {
    DungeonGenerator dungeonGenerator = DungeonGeneratorFactory.getDungeonGenerator(1);
    Dungeon dungeon = dungeonGenerator.generateDungeon();
    Dungeon.setActiveDungeon(dungeon);
    GameInputHandler gameInputHandler = new GameInputHandler();
    PlayerCharacterEntity player = PlayerCharacterEntity.getInstance();
    player.placeCharacterIn(dungeon);
    player.respawn();
    PlayerInputHandler playerInputHandler = new PlayerInputHandler(PlayerCharacterEntity.getInstance());

    camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    camera.zoom = 0.5f;

    batch = new SpriteBatch();

    ui = new UserInterface();

    inputMultiplexer = new InputMultiplexer();
    inputMultiplexer.addProcessor(playerInputHandler);
    inputMultiplexer.addProcessor(ui.getInputProcessor());
    inputMultiplexer.addProcessor(gameInputHandler);
}
 
開發者ID:Tatskaari,項目名稱:DungeonCrawler,代碼行數:23,代碼來源:GameScreen.java

示例9: resetInputProcessing

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void resetInputProcessing () {
	usesMultiplexer = true;
	appInput = Gdx.input.getInputProcessor();
	if (appInput != null) {
		if (hasStage(appInput)) {
			log("Console already added to input processor!", LogLevel.ERROR);
			Gdx.app.log("Console", "Already added to input processor!");
			return;
		}
		multiplexer = new InputMultiplexer();
		multiplexer.addProcessor(stage);
		multiplexer.addProcessor(appInput);
		Gdx.input.setInputProcessor(multiplexer);
	} else {
		Gdx.input.setInputProcessor(stage);
	}
}
 
開發者ID:StrongJoshua,項目名稱:libgdx-inGameConsole,代碼行數:19,代碼來源:GUIConsole.java

示例10: State

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
public State(){
	entities = new Stack<Entity>();
	layeredEntityList = new ArrayList<LayeredEntity>();
	particles = new Stack<Particle>();
	text = new Stack<Text>();
	tiles = new Stack<Entity>();
	cam = new Camera(MyGdxGame.VIRTUAL_WIDTH, MyGdxGame.VIRTUAL_HEIGHT, 1);
	cam3d = new Camera3D(75, MyGdxGame.VIRTUAL_WIDTH, MyGdxGame.VIRTUAL_HEIGHT);
	sb = new SpriteBatch();
	CameraGroupStrategy cgs = new CameraGroupStrategy(cam3d, new LayeredEntity.YComparator());
	db = new DecalBatch(cgs);
	cursor = new Cursor(cam);
	ui = new UI(cursor);
	
	inputMultiplexer = new InputMultiplexer();
	inputMultiplexer.addProcessor(ui);
	Gdx.input.setInputProcessor(inputMultiplexer);
}
 
開發者ID:MisterYO1122,項目名稱:utilsLibGDX,代碼行數:19,代碼來源:State.java

示例11: create

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
public void create()
{
	skin = Global.loadSkin();

	stage = new Stage( new ScreenViewport() );
	batch = new SpriteBatch();

	table = new Table();
	stage.addActor( table );
	table.setFillParent( true );

	inputMultiplexer = new InputMultiplexer();

	InputProcessor inputProcessorOne = this;
	InputProcessor inputProcessorTwo = stage;

	inputMultiplexer.addProcessor( inputProcessorTwo );
	inputMultiplexer.addProcessor( inputProcessorOne );
}
 
開發者ID:infinity8,項目名稱:Roguelike,代碼行數:20,代碼來源:OptionsScreen.java

示例12: create

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void create () {
    resourceManager = new ResourceManager();
    resourceManager.initAllResources();

    menuStage_ = new MenuStage(resourceManager);
    gameStage_ = new GameStage(resourceManager);
    dialogStage = new DialogStage(gameStage_);
    uiStage = new UIStage(resourceManager,gameStage_);

    inputMultiplexer = new InputMultiplexer(); 
    inputMultiplexer.addProcessor(menuStage_); 
    inputMultiplexer.addProcessor(dialogStage); 
    inputMultiplexer.addProcessor(uiStage);
    inputMultiplexer.addProcessor(gameStage_);
    inputMultiplexer.addProcessor(new GestureDetector(new MyGestureListener(this)));
    Gdx.input.setInputProcessor(inputMultiplexer);
}
 
開發者ID:h-victor,項目名稱:elin-game,代碼行數:19,代碼來源:ElinApplication.java

示例13: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void show() {
    InputMultiplexer im = new InputMultiplexer(stage);
    im.addProcessor(new HardInputProcessor() {
        @Override
        public boolean keyUp(int keycode) {
            if (keycode == Keys.BACKSPACE || keycode == Keys.BACK) {
                dispose();
                manager.showMenu();
            }
            return false;
        }
    });
    Gdx.input.setInputProcessor(im);
    Gdx.input.setCatchBackKey(true);
}
 
開發者ID:NaikSoftware,項目名稱:SaveUA,代碼行數:17,代碼來源:SettingsScreen.java

示例14: changeTest

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
void changeTest (int index) {
	// Remove the old behavior and its window
	testsTable.clear();
	if (currentTest != null) {
		if (currentTest.getDetailWindow() != null) currentTest.getDetailWindow().remove();
		currentTest.dispose();
	}

	// Add the new behavior and its window
	currentTest = tests[index];
	currentTest.create();
	InputMultiplexer im = (InputMultiplexer)Gdx.input.getInputProcessor();
	if (im.size() > 1) im.removeProcessor(1);
	if (currentTest.getInputProcessor() != null) im.addProcessor(currentTest.getInputProcessor());
	if (currentTest.getDetailWindow() != null) stage.addActor(currentTest.getDetailWindow());
}
 
開發者ID:libgdx,項目名稱:gdx-ai,代碼行數:17,代碼來源:PathFinderTests.java

示例15: show

import com.badlogic.gdx.InputMultiplexer; //導入方法依賴的package包/類
@Override
public void show() {

	final InputMultiplexer multiplexer = new InputMultiplexer();
	multiplexer.addProcessor(stage);
	multiplexer.addProcessor(inputProcessor);
	Gdx.input.setInputProcessor(multiplexer);

	if (World.getInstance().isDisposed()) {
		try {
			World.getInstance().load();
		} catch (Exception e) {
			EngineLogger.error("ERROR LOADING GAME", e);

			dispose();
			Gdx.app.exit();
		}
	}

	World.getInstance().resume();
}
 
開發者ID:bladecoder,項目名稱:bladecoder-adventure-engine,代碼行數:22,代碼來源:DefaultSceneScreen.java


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