Stage.getViewport
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.badlogic.gdx.scenes.scene2d.Stage.getViewport(Showing top 4 results out of 315)

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: SquidPony/SquidLib

  public void show() {
    if(initialized) {
      stage.getViewport().apply(true);
      stage.draw();
      stage.act();
    }
  }
}
origin: SquidPony/SquidLib

public void update(int width, int height, boolean centerCamera) {
  if(initialized)
  {
    stage.getViewport().update(width, height, centerCamera);
  }
}
origin: SquidPony/SquidLib

/**
 * Not a complete drawing solution; so much of the logic related to drawing is specific to each game, like
 * FOV being used to make certain things not render if they are out of sight, that this doesn't even try to
 * guess at what a particular game needs for its rendering code. You should probably draw any AnimatedEntity
 * objects, like what {@link SquidLayers#animateActor(int, int, char, Color)} returns, separately and after
 * calling this method. The recommended way to draw those objects is with {@link #drawEntity(AnimatedEntity)},
 * which must be called between SpriteBatch's begin() and end() methods, while this method cannot be called
 * between those SpriteBatch methods. The solution, usually, is to call this method, then call
 * {@link SpriteBatch#begin()}, do any logic to determine what AnimatedEntity objects need to be shown (are
 * they in FOV, are they alive, etc.), draw the ones that should be shown with drawEntity(), and finally
 * call {@link SpriteBatch#end()} when no more AnimatedEntity objects need to be drawn. Note that this
 * method renders all of {@link #stage}, which may include other GUI elements using scene2d.ui, but the
 * AnimatedEntity objects in a SquidLayers aren't part of any Stage to allow them to be rendered as special
 * cases for visibility.
 * <br>
 * Specifically, this applies the current viewport to the stage, draws the stage, and makes any actions or
 * events related to the stage take effect. Should not be called inside a {@link SpriteBatch#begin()} block,
 * since this calls it itself by drawing the stage, and also calls {@link SpriteBatch#end()} afterwards.
 */
public void draw()
{
  stage.getViewport().apply(true);
  stage.draw();
  stage.act();
}
com.badlogic.gdx.scenes.scene2dStagegetViewport

Popular methods of Stage

  • act
    Calls the Actor#act(float) method on each actor in the stage. Typically called each frame. This meth
  • addActor
    Adds an actor to the root of the stage.
  • draw
  • <init>
    Creates a stage with the specified viewport and batch. This can be used to avoid creating a new batc
  • getHeight
    The viewport's world height.
  • getRoot
    Returns the root group which holds all actors in the stage.
  • dispose
  • getCamera
    The viewport's camera.
  • getWidth
    The viewport's world width.
  • addAction
    Adds an action to the root of the stage.
  • addListener
    Adds a listener to the root.
  • cancelTouchFocus
    Cancels touch focus for the specified actor.
  • addListener,
  • cancelTouchFocus,
  • clear,
  • getActionsRequestRendering,
  • setKeyboardFocus,
  • setViewport,
  • addCaptureListener,
  • addTouchFocus,
  • calculateScissors

Popular classes and methods

  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TimeZone (java.util)
    TimeZone represents a time zone, primarily used for configuring a Calendar or java.text.SimpleDateF
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JList (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)