当前位置: 首页>>代码示例>>Java>>正文


Java InputMultiplexer类代码示例

本文整理汇总了Java中com.badlogic.gdx.InputMultiplexer的典型用法代码示例。如果您正苦于以下问题:Java InputMultiplexer类的具体用法?Java InputMultiplexer怎么用?Java InputMultiplexer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InputMultiplexer类属于com.badlogic.gdx包,在下文中一共展示了InputMultiplexer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
@Override
public void show() {
	coche = new Coche();
	coche.setPosition(50, 50);
	
	// Creo los controladores.
	controlador = new ControladorVirtual();
	teclado = new EntradaCocheTeclado(controlador);
	raton = new EntradaCocheRaton(controlador);
	
	// Para poder usar ambos a la vez creo multiplexores.
	multiplexor = new InputMultiplexer();
	multiplexor.addProcessor(raton);
	multiplexor.addProcessor(teclado);
	
	// setInputProcessor = poner un controlador o un multiplexor.
	Gdx.input.setInputProcessor(multiplexor);
}
 
开发者ID:makigas,项目名称:tutorial-libgdx,代码行数:19,代码来源:PantallaAuto.java

示例2: 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

示例3: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
@Override
public void show() {
  super.show();

  initMenu();
  InputAdapter escape = new InputAdapter() {
    @Override
    public boolean keyDown(int keycode) {
      if (keycode == Keys.ESCAPE && canEscape) {
        resumeGame();
        return true;
      } else
        return false;
    }
  };
  Gdx.input.setInputProcessor(new InputMultiplexer(escape, stage));
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:18,代码来源:AbstractPausedScreen.java

示例4: 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

示例5: 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

示例6: 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

示例7: initHud

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
private void initHud() {
    hud = new Stage(viewport, batch);
    Gdx.input.setInputProcessor(new InputMultiplexer(new KeyboardInputHandler(), hud));

    //init widgets
    ColorButton[] colorButtons = createColorButtons();
    final ShapeButton[] shapeButtons = createShapeButtons(colorButtons);

    // add widgets to stage
    for (ShapeButton shapeButton : shapeButtons) {
        hud.addActor(shapeButton);
    }
    for (ColorButton colorButton : colorButtons) {
        hud.addActor(colorButton);
    }

    TextureAtlas textureAtlas = polymorph.getAssetManager().get(Polymorph.MASTER_PATH, TextureAtlas.class);
    hud.addActor(createHealthBar(textureAtlas));
    hud.addActor(createPauseButton(textureAtlas));
}
 
开发者ID:DurianHLN,项目名称:Polymorph,代码行数:21,代码来源:GameScreen.java

示例8: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
/**
 * Method responsible for initializing the main menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = settingsAssets.styles_json;
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = settingsAssets.testmainscreen;
    BitmapFont font = settingsAssets.bocklin_fnt;
    TextureRegion backgroundTexture = new TextureRegion(settingsAssets.background_textbutton);

    inputTable = new Table();
    keys = IInputConfig.InputKeys.values();
    keyMap = new HashMap<>();

    initInputRows(font, backgroundTexture);
    createBackButton();
    AL.input.setInputProcessor(new InputMultiplexer(stage, this));
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:28,代码来源:InputSettingsScreen.java

示例9: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
/**
 * Method responsible for initializing the pause menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    // Inits:
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = menuAssets.styles_json;
    skin.getFont("bocklin").getData().setScale(0.8f, 0.8f);
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = menuAssets.testmainscreen;

    createComponents();

    AL.input.setInputProcessor(new InputMultiplexer(stage, this));
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:24,代码来源:PauseMenuScreen.java

示例10: 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

示例11: InputHandlerOld

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
public InputHandlerOld() {
    tempVec = new Vector2();

    activeContexts = new Array<>();
    activeKeyCodes = new ArrayMap<>();
    activePointers = new ArrayMap<>();
    activeMouseInputs = new ArrayMap<>();

    inputListeners = new Array<>();
    inputContexts = new ArrayMap<>();

    keyInputsMap = new ArrayMap<>();
    pointerInputsMap = new ArrayMap<>();
    stickInputsMap = new ArrayMap<>();
    mouseInputsMap = new ArrayMap<>();

    Controllers.addListener(this);

    inputMultiplexer = new InputMultiplexer(this);
    Gdx.input.setInputProcessor(inputMultiplexer);
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:22,代码来源:InputHandlerOld.java

示例12: SystemInputHandler

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
public SystemInputHandler(InputProxy inputProxy, InputMultiplexer inputMultiplexer, Array<NhgInput> systemInputArray) {
    this.inputProxy = inputProxy;

    vec0 = new Vector2();

    keyboardButtonInputs = new IntMap<>();
    mouseButtonInputs = new IntMap<>();
    touchInputs = new IntMap<>();

    activeKeyboardButtonInputs = new Array<>();
    activeMouseButtonInputs = new Array<>();
    activeTouchInputs = new Array<>();

    mapSystemInput(systemInputArray);
    handleSystemInput(inputMultiplexer);
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:17,代码来源:SystemInputHandler.java

示例13: 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

示例14: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
@Override
public void show()
{
    InputAdapter backInputAdapter = new InputAdapter()
    {
        @Override
        public boolean keyUp(int keycode)
        {
            switch (keycode)
            {
                case Input.Keys.ESCAPE:
                case Input.Keys.BACK:
                {
                
                    ScreenManager.removeScreen(TutorialScreen.this);
                    ScreenManager.removeScreen(TutorialScreen.this.gameScreen);
                    return true;
                }
            }
            return false;
        }
    };
    Gdx.input.setInputProcessor(new InputMultiplexer(this.stage, backInputAdapter));
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:25,代码来源:TutorialScreen.java

示例15: show

import com.badlogic.gdx.InputMultiplexer; //导入依赖的package包/类
@Override
public void show()
{
    Gdx.input.setInputProcessor(new InputMultiplexer(this.stage, new InputAdapter()
    {
        @Override
        public boolean keyUp(int keycode)
        {
            switch (keycode)
            {
                case Input.Keys.ESCAPE:
                case Input.Keys.BACK:
                {
                    Gdx.app.exit();
                    return true;
                }
            }
            return false;
        }
    }));
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:22,代码来源:MenuScreen.java


注:本文中的com.badlogic.gdx.InputMultiplexer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。