Tabnine Logo
InputMultiplexer.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.badlogic.gdx.InputMultiplexer
constructor

Best Java code snippets using com.badlogic.gdx.InputMultiplexer.<init> (Showing top 20 results out of 315)

origin: libgdx/libgdx

public InputWrapper (Input input) {
  this.input = input;
  this.multiplexer = new InputMultiplexer();
  this.multiplexer.addProcessor(this);
  input.setInputProcessor(multiplexer);
}
origin: libgdx/libgdx

@Override
public void create () {
  super.create();
  createHUD();
  Gdx.input.setInputProcessor(new InputMultiplexer(hud, this, inputController));
}
origin: libgdx/libgdx

@Override
public void create () {
  if (this.app == null) {
    this.app = Gdx.app;
    Box2DTest test = tests[testIndex];
    test.create();
  }
  InputMultiplexer multiplexer = new InputMultiplexer();
  multiplexer.addProcessor(this);
  multiplexer.addProcessor(new GestureDetector(this));
  Gdx.input.setInputProcessor(multiplexer);
}
origin: stackoverflow.com

 InputProcessor inputProcessorOne = new CustomInputProcessorOne();
InputProcessor inputProcessorTwo = new CustomInputProcessorTwo();
InputMultiplexer inputMultiplexer = new InputMultiplexer();
inputMultiplexer.addProcessor(inputProcessorOne);
inputMultiplexer.addProcessor(inputProcessorTwo);
Gdx.input.setInputProcessor(inputMultiplexer);
origin: libgdx/libgdx

@Override
public void resize (int width, int height) {
  Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController));
  Gdx.gl.glViewport(0, 0, width, height);
  worldCamera.viewportWidth = width;
  worldCamera.viewportHeight = height;
  worldCamera.update();
  ui.getViewport().setWorldSize(width, height);
  ui.getViewport().update(width, height, true);
}
origin: libgdx/libgdx

@Override
public void resize (int width, int height) {
  Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController));
  Gdx.gl.glViewport(0, 0, width, height);
  worldCamera.viewportWidth = width;
  worldCamera.viewportHeight = height;
  worldCamera.update();
  ui.getViewport().setWorldSize(width, height);
  ui.getViewport().update(width, height, true);
}
origin: libgdx/libgdx

@Override
public void create () {
  spriteBatch = new SpriteBatch();
  effect = new ParticleEffect();
  effect.load(Gdx.files.internal("data/singleTextureAllAdditive.p"), Gdx.files.internal("data"));
  effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
  effectPool = new ParticleEffectPool(effect, 20, 20);
  setupUI();
  InputProcessor inputProcessor = new InputAdapter() {
    public boolean touchDragged (int x, int y, int pointer) {
      if (latestEffect != null) latestEffect.setPosition(x, Gdx.graphics.getHeight() - y);
      return false;
    }
    public boolean touchDown (int x, int y, int pointer, int newParam) {
      latestEffect = effectPool.obtain();
      latestEffect.setEmittersCleanUpBlendFunction(!skipCleanup.isChecked());
      latestEffect.setPosition(x, Gdx.graphics.getHeight() - y);
      effects.add(latestEffect);
      return false;
    }
  };
  InputMultiplexer multiplexer = new InputMultiplexer();
  multiplexer.addProcessor(ui);
  multiplexer.addProcessor(inputProcessor);
  Gdx.input.setInputProcessor(multiplexer);
}
origin: libgdx/libgdx

@Override
public void create () {
  if (app == null) {
    app = Gdx.app;
    tests[testIndex].create();
  }
  cameraController = new CameraInputController(tests[testIndex].camera);
  cameraController.activateKey = Keys.CONTROL_LEFT;
  cameraController.autoUpdate = false;
  cameraController.forwardTarget = false;
  cameraController.translateTarget = false;
  Gdx.input.setInputProcessor(new InputMultiplexer(cameraController, this, new GestureDetector(this)));
  font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
  hud = new Stage();
  hud.addActor(fpsLabel = new Label(" ", new Label.LabelStyle(font, Color.WHITE)));
  fpsLabel.setPosition(0, 0);
  hud.addActor(titleLabel = new Label(tests[testIndex].getClass().getSimpleName(), new Label.LabelStyle(font, Color.WHITE)));
  titleLabel.setY(hud.getHeight() - titleLabel.getHeight());
  hud.addActor(instructLabel = new Label("A\nB\nC\nD\nE\nF", new Label.LabelStyle(font, Color.WHITE)));
  instructLabel.setY(titleLabel.getY() - instructLabel.getHeight());
  instructLabel.setAlignment(Align.top | Align.left);
  instructLabel.setText(tests[testIndex].instructions);
}
origin: libgdx/libgdx

@Override
public void create () {
  modelBatch = new ModelBatch(new DefaultShaderProvider());
  environment = new Environment();
  environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f));
  environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
  cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  cam.position.set(10f, 10f, 10f);
  cam.lookAt(0, 0, 0);
  cam.near = 1f;
  cam.far = 30f;
  cam.update();
  ModelBuilder modelBuilder = new ModelBuilder();
  model = modelBuilder.createBox(5f, 5f, 5f, new Material(ColorAttribute.createDiffuse(Color.GREEN)), Usage.Position
    | Usage.Normal);
  instance = new ModelInstance(model);
  Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(cam)));
}
origin: libgdx/libgdx

@Override
public void create () {
  modelBatch = new ModelBatch();
  environment = new Environment();
  environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1.f));
  environment.set(new ColorAttribute(ColorAttribute.Fog, 0.13f, 0.13f, 0.13f, 1f));
  environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
  cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  cam.position.set(30f, 10f, 30f);
  cam.lookAt(0, 0, 0);
  cam.near = 0.1f;
  cam.far = 45f;
  cam.update();
  ModelBuilder modelBuilder = new ModelBuilder();
  model = modelBuilder.createBox(5f, 5f, 5f, new Material(ColorAttribute.createDiffuse(Color.GREEN)), Usage.Position
    | Usage.Normal);
  instance = new ModelInstance(model);
  Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(cam)));
}
origin: libgdx/libgdx

public void create () {
  if (spriteBatch != null) return;
  spriteBatch = new SpriteBatch();
  shapeRenderer = new ShapeRenderer();
  lineColor = com.badlogic.gdx.graphics.Color.valueOf("636363");
  worldCamera = new OrthographicCamera();
  textCamera = new OrthographicCamera();
  pixelsPerMeter = new NumericValue();
  pixelsPerMeter.setValue(1.0f);
  pixelsPerMeter.setAlwaysActive(true);
  zoomLevel = new NumericValue();
  zoomLevel.setValue(1.0f);
  zoomLevel.setAlwaysActive(true);
  deltaMultiplier = new NumericValue();
  deltaMultiplier.setValue(1.0f);
  deltaMultiplier.setAlwaysActive(true);
  backgroundColor = new GradientColorValue();
  backgroundColor.setColors(new float[] {0f, 0f, 0f});
  font = new BitmapFont(Gdx.files.getFileHandle("default.fnt", FileType.Internal), Gdx.files.getFileHandle("default.png",
    FileType.Internal), true);
  effectPanel.newExampleEmitter("Untitled", true);
  // if (resources.openFile("/editor-bg.png") != null) bgImage = new Image(gl, "/editor-bg.png");
  OrthoCamController orthoCamController = new OrthoCamController (worldCamera);
  Gdx.input.setInputProcessor(new InputMultiplexer(orthoCamController, this));
}
origin: libgdx/libgdx

public void create () {
  if (spriteBatch != null) return;
  spriteBatch = new SpriteBatch();
  shapeRenderer = new ShapeRenderer();
  lineColor = com.badlogic.gdx.graphics.Color.valueOf("636363");
  worldCamera = new OrthographicCamera();
  textCamera = new OrthographicCamera();
  pixelsPerMeter = new NumericValue();
  pixelsPerMeter.setValue(1.0f);
  pixelsPerMeter.setAlwaysActive(true);
  zoomLevel = new NumericValue();
  zoomLevel.setValue(1.0f);
  zoomLevel.setAlwaysActive(true);
  deltaMultiplier = new NumericValue();
  deltaMultiplier.setValue(1.0f);
  deltaMultiplier.setAlwaysActive(true);
  backgroundColor = new GradientColorValue();
  backgroundColor.setColors(new float[] {0f, 0f, 0f});
  font = new BitmapFont(Gdx.files.getFileHandle("default.fnt", FileType.Internal), Gdx.files.getFileHandle("default.png",
    FileType.Internal), true);
  effectPanel.newExampleEmitter("Untitled", true);
  // if (resources.openFile("/editor-bg.png") != null) bgImage = new Image(gl, "/editor-bg.png");
  OrthoCamController orthoCamController = new OrthoCamController (worldCamera);
  Gdx.input.setInputProcessor(new InputMultiplexer(orthoCamController, this));
}
origin: libgdx/libgdx

@Override
public void create () {
  Gdx.gl.glClearColor(0.2f, 0.3f, 1.0f, 0.f);
  
  atlas = new TextureAtlas(Gdx.files.internal("data/testpack"));
  regions = atlas.getRegions();
  modelBatch = new ModelBatch(new DefaultShaderProvider());
  environment = new Environment();
  environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f));
  environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
  cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  cam.position.set(10f, 10f, 10f);
  cam.lookAt(0, 0, 0);
  cam.near = 0.1f;
  cam.far = 300f;
  cam.update();
  ModelBuilder modelBuilder = new ModelBuilder();
  final Material material = new Material(ColorAttribute.createDiffuse(1f, 1f, 1f, 1f), new TextureAttribute(TextureAttribute.Diffuse));
  model = modelBuilder.createBox(5f, 5f, 5f, material, Usage.Position | Usage.Normal | Usage.TextureCoordinates);
  instance = new ModelInstance(model);
  attribute = instance.materials.get(0).get(TextureAttribute.class, TextureAttribute.Diffuse);
  Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(cam)));
}

origin: libgdx/libgdx

@Override
public void create () {
  camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  camera.position.set(0, 1.5f, 1.5f);
  camera.lookAt(0, 0, 0);
  camera.update();
  controller = new PerspectiveCamController(camera);
  mesh = new Mesh(true, 4, 4, new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE), new VertexAttribute(
    Usage.TextureCoordinates, 2, ShaderProgram.TEXCOORD_ATTRIBUTE));
  mesh.setVertices(new float[] {-1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, -1, 1, 0, -1, 0, -1, 0, 0,});
  mesh.setIndices(new short[] {0, 1, 2, 3});
  shader = new ShaderProgram(Gdx.files.internal("data/shaders/flattex-vert.glsl").readString(), Gdx.files.internal(
    "data/shaders/flattex-frag.glsl").readString());
  if (!shader.isCompiled()) throw new GdxRuntimeException("shader error: " + shader.getLog());
  textureHW = new Texture(Gdx.files.internal("data/badlogic.jpg"), Format.RGB565, true);
  MipMapGenerator.setUseHardwareMipMap(false);
  textureSW = new Texture(Gdx.files.internal("data/badlogic.jpg"), Format.RGB565, true);
  currTexture = textureHW;
  createUI();
  multiplexer = new InputMultiplexer();
  Gdx.input.setInputProcessor(multiplexer);
  multiplexer.addProcessor(ui);
  multiplexer.addProcessor(controller);
}
origin: libgdx/libgdx

public void create () {
  stage = new Stage();
  Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  label = new Label("", skin);
  Table root = new Table(skin);
  root.setFillParent(true);
  root.setBackground(skin.getDrawable("default-pane"));
  root.debug().defaults().space(6);
  root.add(new TextButton("Button 1", skin));
  root.add(new TextButton("Button 2", skin)).row();
  root.add("Press spacebar to change the viewport:").colspan(2).row();
  root.add(label).colspan(2);
  stage.addActor(root);
  viewports = getViewports(stage.getCamera());
  names = getViewportNames();
  stage.setViewport(viewports.first());
  label.setText(names.first());
  Gdx.input.setInputProcessor(new InputMultiplexer(new InputAdapter() {
    public boolean keyDown (int keycode) {
      if (keycode == Input.Keys.SPACE) {
        int index = (viewports.indexOf(stage.getViewport(), true) + 1) % viewports.size;
        label.setText(names.get(index));
        Viewport viewport = viewports.get(index);
        stage.setViewport(viewport);
        resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      }
      return false;
    }
  }, stage));
}
origin: libgdx/libgdx

stage.addActor(table);
Gdx.input.setInputProcessor(new InputMultiplexer(new InputAdapter() {
  public boolean scrolled (int amount) {
    if (!Gdx.input.isKeyPressed(Keys.CONTROL_LEFT)) return false;
origin: libgdx/libgdx

instance = new ModelInstance(model);
Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(perspectiveCamera)));
origin: libgdx/libgdx

floorInstance = new ModelInstance(modelBuilder.end());
Gdx.input.setInputProcessor(new InputMultiplexer(this, cameraController));
origin: stackoverflow.com

this.multiInputProcessor = new InputMultiplexer();
origin: com.badlogicgames.gdx/gdx-tools

@Override
public void resize (int width, int height) {
  Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController));
  Gdx.gl.glViewport(0, 0, width, height);
  worldCamera.viewportWidth = width;
  worldCamera.viewportHeight = height;
  worldCamera.update();
  ui.getViewport().setWorldSize(width, height);
  ui.getViewport().update(width, height, true);
}
com.badlogic.gdxInputMultiplexer<init>

Popular methods of InputMultiplexer

  • addProcessor
  • removeProcessor
  • clear
  • getProcessors
  • size
  • setProcessors

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now