congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NinePatch.prepareVertices
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float width, float height) {
  prepareVertices(batch, x, y, width, height);
  batch.draw(texture, vertices, 0, idx);
}
origin: libgdx/libgdx

public void draw (Batch batch, float x, float y, float width, float height) {
  prepareVertices(batch, x, y, width, height);
  batch.draw(texture, vertices, 0, idx);
}
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) {
  prepareVertices(batch, x, y, width, height);
  float worldOriginX = x + originX, worldOriginY = y + originY;
  int n = this.idx;
  float[] vertices = this.vertices;
  if (rotation != 0) {
    for (int i = 0; i < n; i += 5) {
      float vx = (vertices[i] - worldOriginX) * scaleX, vy = (vertices[i + 1] - worldOriginY) * scaleY;
      float cos = MathUtils.cosDeg(rotation), sin = MathUtils.sinDeg(rotation);
      vertices[i] = cos * vx - sin * vy + worldOriginX;
      vertices[i + 1] = sin * vx + cos * vy + worldOriginY;
    }
  } else if (scaleX != 1 || scaleY != 1) {
    for (int i = 0; i < n; i += 5) {
      vertices[i] = (vertices[i] - worldOriginX) * scaleX + worldOriginX;
      vertices[i + 1] = (vertices[i + 1] - worldOriginY) * scaleY + worldOriginY;
    }
  }
  batch.draw(texture, vertices, 0, n);
}
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) {
  prepareVertices(batch, x, y, width, height);
  float worldOriginX = x + originX, worldOriginY = y + originY;
  int n = this.idx;
  float[] vertices = this.vertices;
  if (rotation != 0) {
    for (int i = 0; i < n; i += 5) {
      float vx = (vertices[i] - worldOriginX) * scaleX, vy = (vertices[i + 1] - worldOriginY) * scaleY;
      float cos = MathUtils.cosDeg(rotation), sin = MathUtils.sinDeg(rotation);
      vertices[i] = cos * vx - sin * vy + worldOriginX;
      vertices[i + 1] = sin * vx + cos * vy + worldOriginY;
    }
  } else if (scaleX != 1 || scaleY != 1) {
    for (int i = 0; i < n; i += 5) {
      vertices[i] = (vertices[i] - worldOriginX) * scaleX + worldOriginX;
      vertices[i + 1] = (vertices[i + 1] - worldOriginY) * scaleY + worldOriginY;
    }
  }
  batch.draw(texture, vertices, 0, n);
}
origin: com.badlogicgames.gdx/gdx

public void draw (Batch batch, float x, float y, float width, float height) {
  prepareVertices(batch, x, y, width, height);
  batch.draw(texture, vertices, 0, idx);
}
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) {
  prepareVertices(batch, x, y, width, height);
  float worldOriginX = x + originX, worldOriginY = y + originY;
  int n = this.idx;
  float[] vertices = this.vertices;
  if (rotation != 0) {
    for (int i = 0; i < n; i += 5) {
      float vx = (vertices[i] - worldOriginX) * scaleX, vy = (vertices[i + 1] - worldOriginY) * scaleY;
      float cos = MathUtils.cosDeg(rotation), sin = MathUtils.sinDeg(rotation);
      vertices[i] = cos * vx - sin * vy + worldOriginX;
      vertices[i + 1] = sin * vx + cos * vy + worldOriginY;
    }
  } else if (scaleX != 1 || scaleY != 1) {
    for (int i = 0; i < n; i += 5) {
      vertices[i] = (vertices[i] - worldOriginX) * scaleX + worldOriginX;
      vertices[i + 1] = (vertices[i + 1] - worldOriginY) * scaleY + worldOriginY;
    }
  }
  batch.draw(texture, vertices, 0, n);
}
com.badlogic.gdx.graphics.g2dNinePatchprepareVertices

Popular methods of NinePatch

  • <init>
    Construct a nine patch from the given nine texture regions. The provided patches must be consistentl
  • draw
  • 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().
  • getPadLeft,
  • getPadRight,
  • getPadTop,
  • getTexture,
  • getTopHeight,
  • load,
  • set,
  • setPadding,
  • getColor

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JLabel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Table (org.hibernate.mapping)
    A relational table
  • Top 12 Jupyter Notebook extensions
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