/** Adjusts the xadvance of the last glyph to use its width instead of xadvance. */ private void adjustLastGlyph (BitmapFontData fontData, GlyphRun run) { Glyph last = run.glyphs.peek(); if (last.fixedWidth) return; float width = (last.width + last.xoffset) * fontData.scaleX - fontData.padRight; run.width += width - run.xAdvances.peek(); // Can cause the run width to be > targetWidth, but the problem is minimal. run.xAdvances.set(run.xAdvances.size - 1, width); }
/** Adjusts the xadvance of the last glyph to use its width instead of xadvance. */ private void adjustLastGlyph (BitmapFontData fontData, GlyphRun run) { Glyph last = run.glyphs.peek(); if (last.fixedWidth) return; float width = (last.width + last.xoffset) * fontData.scaleX - fontData.padRight; run.width += width - run.xAdvances.peek(); // Can cause the run width to be > targetWidth, but the problem is minimal. run.xAdvances.set(run.xAdvances.size - 1, width); }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
run.xAdvances.removeRange(1, wrapIndex); run.xAdvances.set(0, -run.glyphs.first().xoffset * fontData.scaleX - fontData.padLeft);
run.xAdvances.removeRange(1, wrapIndex); run.xAdvances.set(0, -run.glyphs.first().xoffset * fontData.scaleX - fontData.padLeft);
xAdvances2.set(0, -glyphs2.first().xoffset * fontData.scaleX - fontData.padLeft); first.xAdvances = xAdvances1; second.xAdvances = xAdvances2;
xAdvances2.set(0, -glyphs2.first().xoffset * fontData.scaleX - fontData.padLeft); first.xAdvances = xAdvances1; second.xAdvances = xAdvances2;
/** * @param handleBarIndex * index of handle bar starting from zero, max index is number of * widgets - 1 * @param split * new value of split, must be greater than 0 and lesser than 1 * and must be smaller and bigger than previous and next split * value. Invalid values will be clamped to closest valid one. */ public void setSplit(int handleBarIndex, float split) { if (handleBarIndex < 0) throw new IllegalStateException("handleBarIndex can't be < 0"); if (handleBarIndex >= splits.size) throw new IllegalStateException("handleBarIndex can't be >= splits size"); // float minSplit = handleOverIndex == 0 ? 0 : // splits.get(handleOverIndex - 1); // @Changed // float maxSplit = handleOverIndex == splits.size - 1 ? 1 : // splits.get(handleOverIndex + 1); // split = MathUtils.clamp(split, minSplit, maxSplit); splits.set(handleBarIndex, split); }
/** Adjusts the xadvance of the last glyph to use its width instead of xadvance. */ private void adjustLastGlyph (BitmapFontData fontData, GlyphRun run) { Glyph last = run.glyphs.peek(); if (last.fixedWidth) return; float width = (last.width + last.xoffset) * fontData.scaleX - fontData.padRight; run.width += width - run.xAdvances.peek(); // Can cause the run width to be > targetWidth, but the problem is minimal. run.xAdvances.set(run.xAdvances.size - 1, width); }
/** * @param handleBarIndex index of handle bar starting from zero, max index is number of widgets - 1 * @param split new value of split, must be greater than 0 and lesser than 1 and must be smaller and bigger than * previous and next split value. Invalid values will be clamped to closest valid one. */ public void setSplit (int handleBarIndex, float split) { if (handleBarIndex < 0) throw new IllegalStateException("handleBarIndex can't be < 0"); if (handleBarIndex >= splits.size) throw new IllegalStateException("handleBarIndex can't be >= splits size"); float minSplit = handleBarIndex == 0 ? 0 : splits.get(handleBarIndex - 1); float maxSplit = handleBarIndex == splits.size - 1 ? 1 : splits.get(handleBarIndex + 1); split = MathUtils.clamp(split, minSplit, maxSplit); splits.set(handleBarIndex, split); }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
private boolean fill (int bufferID) { tempBuffer.clear(); int length = read(tempBytes); if (length <= 0) { if (isLooping) { loop(); length = read(tempBytes); if (length <= 0) return false; if (renderedSecondsQueue.size > 0) { renderedSecondsQueue.set(0, 0); } } else return false; } float previousLoadedSeconds = renderedSecondsQueue.size > 0 ? renderedSecondsQueue.first() : 0; float currentBufferSeconds = maxSecondsPerBuffer * (float)length / (float)bufferSize; renderedSecondsQueue.insert(0, previousLoadedSeconds + currentBufferSeconds); tempBuffer.put(tempBytes, 0, length).flip(); alBufferData(bufferID, format, tempBuffer, sampleRate); return true; }
run.xAdvances.removeRange(1, wrapIndex); run.xAdvances.set(0, -run.glyphs.first().xoffset * fontData.scaleX - fontData.padLeft);
xAdvances2.set(0, -glyphs2.first().xoffset * fontData.scaleX - fontData.padLeft); first.xAdvances = xAdvances1; second.xAdvances = xAdvances2;