Codota Logo
NinePatch.draw
Code IndexAdd Codota to your IDE (free)

How to use
draw
method
in
com.badlogic.gdx.graphics.g2d.NinePatch

Best Java code snippets using com.badlogic.gdx.graphics.g2d.NinePatch.draw (Showing top 12 results out of 315)

  • Common ways to obtain NinePatch
private void myMethod () {
NinePatch n =
  • Codota IconTextureRegion region;new NinePatch(region)
  • Codota IconTextureRegion region;new NinePatch(region, left, right, top, left)
  • Smart code suggestions by Codota
}
origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX,
  float scaleY, float rotation) {
  patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation);
}
origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX,
  float scaleY, float rotation) {
  patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation);
}
origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float width, float height) {
  patch.draw(batch, x, y, width, height);
}
origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float width, float height) {
  patch.draw(batch, x, y, width, height);
}
origin: libgdx/libgdx

@Override
public void render () {
  Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  int size = Math.min(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  int quarterSize = (int) (size/4f);
  batch.begin();
  batch.draw(textureRegions.get(pageToShow), 0, 0, size, size);
  ninePatch.draw(batch, 10, 10, quarterSize, quarterSize);
  officialPatch.draw(batch, (int)(size * 0.25f + 20), 10, quarterSize, quarterSize);
  batch.end();
  shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
  shapeRenderer.setColor(Color.GREEN);
  shapeRenderer.rect(0, 0, size, size);
  shapeRenderer.end();
}
origin: libgdx/libgdx

@Override
public void render () {
  Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  int size = Math.min(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  int quarterSize = (int) (size/4f);
  batch.begin();
  batch.draw(textureRegions.get(pageToShow), 0, 0, size, size);
  ninePatch.draw(batch, 10, 10, quarterSize, quarterSize);
  officialPatch.draw(batch, (int)(size * 0.25f + 20), 10, quarterSize, quarterSize);
  batch.draw(animation.getKeyFrame(stateTime), 30 + (quarterSize * 2), 10, quarterSize, quarterSize);
  batch.end();
  shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
  shapeRenderer.setColor(Color.GREEN);
  shapeRenderer.rect(0, 0, size, size);
  shapeRenderer.end();
  stateTime += Gdx.graphics.getDeltaTime();
}
origin: libgdx/libgdx

  np1.draw(b, x, y, pwidth, pheight);
    final int pwidth2 = screenWidth - XGAP - x2;
    np2.draw(b, x2, y, pwidth2, pheight);
filterColor.set(0.3f, 0.3f, 0.3f, 1.0f);
np.setColor(filterColor);
np.draw(b, x, y, 100, 30);
np.setColor(oldColor);
origin: udacity/ud406

public void render(SpriteBatch batch) {
  final float width = right - left;
  final float height = top - bottom;
  Assets.instance.platformAssets.platformNinePatch.draw(batch, left - 1, bottom - 1, width + 2, height + 2);
}
origin: com.badlogicgames.gdx/gdx

public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX,
  float scaleY, float rotation) {
  patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation);
}
origin: com.badlogicgames.gdx/gdx

public void draw (Batch batch, float x, float y, float width, float height) {
  patch.draw(batch, x, y, width, height);
}
origin: udacity/ud406

@Override
public void render() {
  viewport.apply();
  Gdx.gl.glClearColor(1, 1, 1, 1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batch.setProjectionMatrix(viewport.getCamera().combined);
  batch.begin();
  // TODO: Draw the platform texture at TEST_SIZE_1
  batch.draw(platformTexture,
      WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2, WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2,
      TEST_SIZE_1, TEST_SIZE_1);
  // TODO: Draw the platform texture at TEST_SIZE_2
  batch.draw(platformTexture,
      WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2, WORLD_SIZE * 1 / 4 - TEST_SIZE_2 / 2,
      TEST_SIZE_2, TEST_SIZE_2);
  // TODO: Draw the nine patch at TEST_SIZE_1
  platformNinePatch.draw(batch,
      WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2, WORLD_SIZE * 3 / 4 - TEST_SIZE_1 / 2,
      TEST_SIZE_1, TEST_SIZE_1);
  // TODO: Draw the nine patch at TEST_SIZE_2
  platformNinePatch.draw(batch,
      WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2, WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2,
      TEST_SIZE_2, TEST_SIZE_2);
  batch.end();
}
origin: crashinvaders/gdx-texture-packer-gui

@Override
public void draw(Batch batch, float parentAlpha) {
  if (region == null) return;
  // Frame
  float scale = PageGroup.this.getScaleX();
  float x = getX() + (region.getX() - framePad) * scale;
  float y = getY() + (region.getPage().getHeight() - region.getY() - region.getHeight() - framePad) * scale; // Texture region has top-left axis origin
  float width = (region.getWidth() + framePad*2f) * scale;
  float height = (region.getHeight() + framePad*2f) * scale;
  batch.setColor(colorSpotlight);
  spotlightBorder.draw(batch, x, y, width, height);
  // Text
  float textX = x + width*0.5f - glText.width*0.5f;
  float textY = y - glText.height - 4f;
  batch.setColor(colorTextFrame);
  batch.draw(whiteTex, textX-10f, textY - 6f, glText.width+20f, glText.height + 10f);
  batch.setColor(Color.WHITE);
  font.getData().setScale(1f);
  font.draw(batch, glText, textX, textY + glText.height);
}
com.badlogic.gdx.graphics.g2dNinePatchdraw

Popular methods of NinePatch

  • <init>
    Construct a nine patch from the given nine texture regions. The provided patches must be consistentl
  • setColor
    Copy given color. The color will be blended with the batch color, then combined with the texture col
  • getBottomHeight
  • getRightWidth
  • getTotalHeight
  • getTotalWidth
  • add
  • getLeftWidth
  • getPadBottom
    Returns the bottom padding if set, else returns #getBottomHeight().
  • getPadLeft
    Returns the left padding if set, else returns #getLeftWidth().
  • getPadRight
    Returns the right padding if set, else returns #getRightWidth().
  • getPadTop
    Returns the top padding if set, else returns #getTopHeight().
  • getPadRight,
  • getPadTop,
  • getTexture,
  • getTopHeight,
  • load,
  • prepareVertices,
  • set,
  • setPadding,
  • getColor

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now