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

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

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

Array.with介绍

暂无

代码示例

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

/** Constructs a new BitmapFont from the given {@link BitmapFontData} and {@link TextureRegion}. If the TextureRegion is null,
 * the image path(s) will be read from the BitmapFontData. The dispose() method will not dispose the texture of the region(s)
 * if the region is != null.
 * <p>
 * Passing a single TextureRegion assumes that your font only needs a single texture page. If you need to support multiple
 * pages, either let the Font read the images themselves (by specifying null as the TextureRegion), or by specifying each page
 * manually with the TextureRegion[] constructor.
 * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */
public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
  this(data, region != null ? Array.with(region) : null, integer);
}

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

/** Constructs a new BitmapFont from the given {@link BitmapFontData} and {@link TextureRegion}. If the TextureRegion is null,
 * the image path(s) will be read from the BitmapFontData. The dispose() method will not dispose the texture of the region(s)
 * if the region is != null.
 * <p>
 * Passing a single TextureRegion assumes that your font only needs a single texture page. If you need to support multiple
 * pages, either let the Font read the images themselves (by specifying null as the TextureRegion), or by specifying each page
 * manually with the TextureRegion[] constructor.
 * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */
public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
  this(data, region != null ? Array.with(region) : null, integer);
}

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

equals(json.toJson(" meow "), "\" meow \"");
equals(json.toJson("\nmeow\n"), "\\nmeow\\n");
equals(json.toJson(Array.with(1, 2, 3), null, int.class), "[1,2,3]");
equals(json.toJson(Array.with("1", "2", "3"), null, String.class), "[1,2,3]");
equals(json.toJson(Array.with(" 1", "2 ", " 3 "), null, String.class), "[\" 1\",\"2 \",\" 3 \"]");
equals(json.toJson(Array.with("1", "", "3"), null, String.class), "[1,\"\",3]");

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

/** Constructs a new BitmapFont from the given {@link BitmapFontData} and {@link TextureRegion}. If the TextureRegion is null,
 * the image path(s) will be read from the BitmapFontData. The dispose() method will not dispose the texture of the region(s)
 * if the region is != null.
 * <p>
 * Passing a single TextureRegion assumes that your font only needs a single texture page. If you need to support multiple
 * pages, either let the Font read the images themselves (by specifying null as the TextureRegion), or by specifying each page
 * manually with the TextureRegion[] constructor.
 * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */
public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
  this(data, region != null ? Array.with(region) : null, integer);
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

public void launchPack(ProjectModel project, PackModel pack) {
  launchPack(project, Array.with(pack));
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

public void setToSuccess() {
  imgStateIndicator.setFrames(Array.with(VisUI.getSkin().getDrawable("custom/ic-proc-success")));
  imgStateIndicator.setCurrentFrame(0);
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

public void setToError(Exception e) {
  imgStateIndicator.setFrames(Array.with(VisUI.getSkin().getDrawable("custom/ic-proc-error")));
  imgStateIndicator.setCurrentFrame(0);
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

private Array<PackProcessingNode> prepareProcessingNodes(ProjectModel project, Array<PackModel> packs) {
  Array<PackProcessingNode> result = new Array<>();
  for (PackModel pack : packs) {
    for (ScaleFactorModel scaleFactor : pack.getScaleFactors()) {
      PackModel newPack = new PackModel(pack);
      newPack.setScaleFactors(Array.with(scaleFactor));
      TexturePacker.Settings settings = newPack.getSettings();
      settings.scaleSuffix[0] = "";
      settings.scale[0] = scaleFactor.getFactor();
      settings.scaleResampling[0] = scaleFactor.getResampling();
      PackProcessingNode processingNode = new PackProcessingNode(project, newPack);
      processingNode.setOrigPack(pack);
      result.add(processingNode);
    }
  }
  return result;
}

相关文章