congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 15 Vim Plugins
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