public void load (BufferedReader reader) throws IOException { super.load(reader); if (!active) return; shape = SpawnShape.valueOf(readString(reader, "shape")); if (shape == SpawnShape.ellipse) { edges = readBoolean(reader, "edges"); side = SpawnEllipseSide.valueOf(readString(reader, "side")); } }
private void renderSingleLine () { String text = "Single Line"; float x = logoSprite.getX(); float y = logoSprite.getY(); float width = logoSprite.getWidth(); float height = logoSprite.getHeight(); layout.setText(font, text); x += width / 2 - layout.width / 2; y += height / 2 + layout.height / 2; font.draw(spriteBatch, text, x, y); }
@Override public void draw (TextureRegion region, float x, float y) { if (!adjustNeeded) { super.draw(region, x, y); } else { drawAdjusted(region, x, y, 0, 0, region.getRegionWidth(), region.getRegionHeight(), 1, 1, 0); } }
/** Creates a sprite based on a specific TextureRegion, the new sprite's region is a copy of the parameter region - altering one * does not affect the other */ public Sprite (TextureRegion region) { setRegion(region); setColor(1, 1, 1, 1); setSize(region.getRegionWidth(), region.getRegionHeight()); setOrigin(width / 2, height / 2); }
private Sprite newSprite (AtlasRegion region) { if (region.packedWidth == region.originalWidth && region.packedHeight == region.originalHeight) { if (region.rotate) { Sprite sprite = new Sprite(region); sprite.setBounds(0, 0, region.getRegionHeight(), region.getRegionWidth()); sprite.rotate90(true); return sprite; } return new Sprite(region); } return new AtlasSprite(region); }
public AtlasRegion (TextureRegion region) { setRegion(region); packedWidth = region.getRegionWidth(); packedHeight = region.getRegionHeight(); originalWidth = packedWidth; originalHeight = packedHeight; }
@Override public void draw (Texture texture, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation, int srcX, int srcY, int srcWidth, int srcHeight, boolean flipX, boolean flipY) { if (!adjustNeeded) { super.draw(texture, x, y, originX, originY, width, height, scaleX, scaleY, rotation, srcX, srcY, srcWidth, srcHeight, flipX, flipY); } else { drawAdjusted(texture, x, y, originX, originY, width, height, scaleX, scaleY, rotation, srcX, srcY, srcWidth, srcHeight, flipX, flipY); } }
@Override public void draw (Texture texture, float x, float y, float width, float height, float u, float v, float u2, float v2) { if (!adjustNeeded) { super.draw(texture, x, y, width, height, u, v, u2, v2); } else { drawAdjustedUV(texture, x, y, 0, 0, width, height, 1, 1, 0, u, v, u2, v2, false, false); } }
public void getGlyphs (GlyphRun run, CharSequence str, int start, int end, Glyph lastGlyph) { if (packer != null) packer.setPackToTexture(true); // All glyphs added after this are packed directly to the texture. super.getGlyphs(run, str, start, end, lastGlyph); if (dirty) { dirty = false; packer.updateTextureRegions(regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); } }
@Override public void draw (Batch spriteBatch, int start, int end) { setSmoothingUniform(spriteBatch, getSmoothingFactor()); super.draw(spriteBatch, start, end); setSmoothingUniform(spriteBatch, 0); } }
/** Permanently scales the size of the emitter by scaling all its ranged values related to size. */ public void scaleSize (float scaleX, float scaleY) { if (scaleX == 1f && scaleY == 1f) return; for (RangedNumericValue value : getXSizeValues()) value.scale(scaleX); for (RangedNumericValue value : getYSizeValues()) value.scale(scaleY); }
@Override public void draw (TextureRegion region, float x, float y) { if (!adjustNeeded) { super.draw(region, x, y); } else { drawAdjusted(region, x, y, 0, 0, region.getRegionWidth(), region.getRegionHeight(), 1, 1, 0); } }
private Sprite newSprite (AtlasRegion region) { if (region.packedWidth == region.originalWidth && region.packedHeight == region.originalHeight) { if (region.rotate) { Sprite sprite = new Sprite(region); sprite.setBounds(0, 0, region.getRegionHeight(), region.getRegionWidth()); sprite.rotate90(true); return sprite; } return new Sprite(region); } return new AtlasSprite(region); }
@Override public void draw (TextureRegion region, float x, float y, float width, float height) { if (!adjustNeeded) { super.draw(region, x, y, width, height); } else { drawAdjusted(region, x, y, 0, 0, width, height, 1, 1, 0); } }
public void load (BufferedReader reader) throws IOException { super.load(reader); if (!active) return; shape = SpawnShape.valueOf(readString(reader, "shape")); if (shape == SpawnShape.ellipse) { edges = readBoolean(reader, "edges"); side = SpawnEllipseSide.valueOf(readString(reader, "side")); } }