public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { batch.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { batch.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation); }
public void draw (Batch batch, float x, float y, float width, float height) { batch.draw(region, x, y, width, height); }
public void draw (Batch batch, float x, float y, float width, float height) { batch.draw(region, x, y, width, height); }
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); }
public void draw (Batch batch) { batch.draw(texture, getVertices(), 0, SPRITE_SIZE); }
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); }
public void draw (Batch batch) { batch.draw(texture, getVertices(), 0, SPRITE_SIZE); }
@Override public void draw (Batch batch, float parentAlpha) { batch.draw(region, getX(), getY()); } }
public void draw (Batch spriteBatch) { Array<TextureRegion> regions = font.getRegions(); for (int j = 0, n = pageVertices.length; j < n; j++) { if (idx[j] > 0) { // ignore if this texture has no glyphs float[] vertices = pageVertices[j]; spriteBatch.draw(regions.get(j).getTexture(), vertices, 0, idx[j]); } } }
public void draw (Batch spriteBatch) { Array<TextureRegion> regions = font.getRegions(); for (int j = 0, n = pageVertices.length; j < n; j++) { if (idx[j] > 0) { // ignore if this texture has no glyphs float[] vertices = pageVertices[j]; spriteBatch.draw(regions.get(j).getTexture(), vertices, 0, idx[j]); } } }
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); }
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); }
private void renderKoala (float deltaTime) { // based on the koala state, get the animation frame TextureRegion frame = null; switch (koala.state) { case Standing: frame = stand.getKeyFrame(koala.stateTime); break; case Walking: frame = walk.getKeyFrame(koala.stateTime); break; case Jumping: frame = jump.getKeyFrame(koala.stateTime); break; } // draw the koala, depending on the current velocity // on the x-axis, draw the koala facing either right // or left Batch batch = renderer.getBatch(); batch.begin(); if (koala.facesRight) { batch.draw(frame, koala.position.x, koala.position.y, Koala.WIDTH, Koala.HEIGHT); } else { batch.draw(frame, koala.position.x + Koala.WIDTH, koala.position.y, -Koala.WIDTH, Koala.HEIGHT); } batch.end(); }
public void draw (Batch spriteBatch, int start, int end) { if (pageVertices.length == 1) { // 1 page. spriteBatch.draw(font.getRegion().getTexture(), pageVertices[0], start * 20, (end - start) * 20); return; } // Determine vertex offset and count to render for each page. Some pages might not need to be rendered at all. Array<TextureRegion> regions = font.getRegions(); for (int i = 0, pageCount = pageVertices.length; i < pageCount; i++) { int offset = -1, count = 0; // For each set of glyph indices, determine where to begin within the start/end bounds. IntArray glyphIndices = pageGlyphIndices[i]; for (int ii = 0, n = glyphIndices.size; ii < n; ii++) { int glyphIndex = glyphIndices.get(ii); // Break early if the glyph is out of bounds. if (glyphIndex >= end) break; // Determine if this glyph is within bounds. Use the first match of that for the offset. if (offset == -1 && glyphIndex >= start) offset = ii; // Determine the vertex count by counting glyphs within bounds. if (glyphIndex >= start) // && gInd < end count++; } // Page doesn't need to be rendered. if (offset == -1 || count == 0) continue; // Render the page vertex data with the offset and count. spriteBatch.draw(regions.get(i).getTexture(), pageVertices[i], offset * 20, count * 20); } }
public void draw (Batch spriteBatch, int start, int end) { if (pageVertices.length == 1) { // 1 page. spriteBatch.draw(font.getRegion().getTexture(), pageVertices[0], start * 20, (end - start) * 20); return; } // Determine vertex offset and count to render for each page. Some pages might not need to be rendered at all. Array<TextureRegion> regions = font.getRegions(); for (int i = 0, pageCount = pageVertices.length; i < pageCount; i++) { int offset = -1, count = 0; // For each set of glyph indices, determine where to begin within the start/end bounds. IntArray glyphIndices = pageGlyphIndices[i]; for (int ii = 0, n = glyphIndices.size; ii < n; ii++) { int glyphIndex = glyphIndices.get(ii); // Break early if the glyph is out of bounds. if (glyphIndex >= end) break; // Determine if this glyph is within bounds. Use the first match of that for the offset. if (offset == -1 && glyphIndex >= start) offset = ii; // Determine the vertex count by counting glyphs within bounds. if (glyphIndex >= start) // && gInd < end count++; } // Page doesn't need to be rendered. if (offset == -1 || count == 0) continue; // Render the page vertex data with the offset and count. spriteBatch.draw(regions.get(i).getTexture(), pageVertices[i], offset * 20, count * 20); } }
@Override public void draw (Batch batch, float parentAlpha) { batch.draw(textureRegion, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation()); } }
public void draw (Batch batch, float parentAlpha) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, parentAlpha); batch.draw(region, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation()); } };
vertices[V4] = v1; batch.draw(region.getTexture(), vertices, 0, NUM_VERTICES);
public void draw (Batch batch, float parentAlpha) { // Use Stage#toScreenCoordinates, which we know is correct. toScreenCoordinates.set(testX, testY).sub(getOriginX(), getOriginY()).scl(getScaleX(), getScaleY()).rotate(getRotation()) .add(getOriginX(), getOriginY()).add(getX(), getY()); getStage().toScreenCoordinates(toScreenCoordinates, batch.getTransformMatrix()); // Do the same as toScreenCoordinates via Actor#localToParentCoordinates. localToAscendantCoordinates(null, localToParentCoordinates.set(testX, testY)); getStage().stageToScreenCoordinates(localToParentCoordinates); // System.out.println(name + " " + toScreenCoordinates + " " + localToParentCoordinates); batch.setColor(getColor()); batch.draw(region, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation()); super.draw(batch, parentAlpha); } }