Tabnine Logo
NinePatch.draw
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Runner (org.openjdk.jmh.runner)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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