当前位置: 首页>>代码示例>>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;未经允许,请勿转载。