com.badlogic.gdx.utils.Array.truncate()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中com.badlogic.gdx.utils.Array.truncate()方法的一些代码示例,展示了Array.truncate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.truncate()方法的具体详情如下:
包路径:com.badlogic.gdx.utils.Array
类名称:Array
方法名:truncate

Array.truncate介绍

[英]Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken.
[中]将数组的大小减小到指定的大小。如果阵列已小于指定的大小,则不采取任何操作。

代码示例

代码示例来源:origin: libgdx/libgdx

public void truncate (int newSize) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.truncate(newSize);
}

代码示例来源:origin: libgdx/libgdx

public void truncate (int newSize) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.truncate(newSize);
}

代码示例来源:origin: libgdx/libgdx

/** Sets the array size, leaving any values beyond the current size null.
 * @return {@link #items} */
public T[] setSize (int newSize) {
  truncate(newSize);
  if (newSize > items.length) resize(Math.max(8, newSize));
  size = newSize;
  return items;
}

代码示例来源:origin: libgdx/libgdx

/** Sets the array size, leaving any values beyond the current size null.
 * @return {@link #items} */
public T[] setSize (int newSize) {
  truncate(newSize);
  if (newSize > items.length) resize(Math.max(8, newSize));
  size = newSize;
  return items;
}

代码示例来源:origin: libgdx/libgdx

public void truncate (int newSize) {
  modified();
  super.truncate(newSize);
}

代码示例来源:origin: libgdx/libgdx

public void truncate (int newSize) {
  modified();
  super.truncate(newSize);
}

代码示例来源:origin: libgdx/libgdx

run.glyphs.truncate(count - 1);
run.xAdvances.truncate(count);
adjustLastGlyph(fontData, run);

代码示例来源:origin: libgdx/libgdx

run.glyphs.truncate(count - 1);
run.xAdvances.truncate(count);
adjustLastGlyph(fontData, run);

代码示例来源:origin: libgdx/libgdx

previous.width -= previous.xAdvances.get(lastIndex + 1);
previous.glyphs.truncate(lastIndex + 1);
previous.xAdvances.truncate(lastIndex + 2);
adjustLastGlyph(fontData, previous);

代码示例来源:origin: libgdx/libgdx

previous.width -= previous.xAdvances.get(lastIndex + 1);
previous.glyphs.truncate(lastIndex + 1);
previous.xAdvances.truncate(lastIndex + 2);
adjustLastGlyph(fontData, previous);

代码示例来源:origin: libgdx/libgdx

} else {
  glyphs2.truncate(firstEnd);
  xAdvances2.truncate(firstEnd + 1);

代码示例来源:origin: libgdx/libgdx

} else {
  glyphs2.truncate(firstEnd);
  xAdvances2.truncate(firstEnd + 1);

代码示例来源:origin: com.badlogicgames.gdx/gdx

public void truncate (int newSize) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.truncate(newSize);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Sets the array size, leaving any values beyond the current size null.
 * @return {@link #items} */
public T[] setSize (int newSize) {
  truncate(newSize);
  if (newSize > items.length) resize(Math.max(8, newSize));
  size = newSize;
  return items;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public void truncate (int newSize) {
  modified();
  super.truncate(newSize);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

run.glyphs.truncate(count - 1);
run.xAdvances.truncate(count);
adjustLastGlyph(fontData, run);

代码示例来源:origin: com.badlogicgames.gdx/gdx

previous.width -= previous.xAdvances.get(lastIndex + 1);
previous.glyphs.truncate(lastIndex + 1);
previous.xAdvances.truncate(lastIndex + 2);
adjustLastGlyph(fontData, previous);

代码示例来源:origin: com.badlogicgames.gdx/gdx

} else {
  glyphs2.truncate(firstEnd);
  xAdvances2.truncate(firstEnd + 1);

相关文章