com.badlogic.gdx.Graphics.getDisplayModes()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(182)

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

Graphics.getDisplayModes介绍

暂无

代码示例

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

@Override
public void create () {
  DisplayMode displayMode = Gdx.graphics.getDisplayMode();
  DisplayMode displayModeForMonitor = Gdx.graphics.getDisplayMode(Gdx.graphics.getMonitor());
  DisplayMode[] displayModes = Gdx.graphics.getDisplayModes();
  DisplayMode[] displayModesForMonitor = Gdx.graphics.getDisplayModes(Gdx.graphics.getMonitor());
  Gdx.app.log("DisplayModeTest", "Display mode (using Gdx.graphics.getDisplayMode() ) : " + displayMode);
  Gdx.app.log("DisplayModeTest",
    "Display mode (using Gdx.graphics.getDisplayMode(Gdx.graphics.getMonitor()) ) : " + Arrays.toString(displayModes));
  Gdx.app.log("DisplayModeTest",
    "Display mode (using Gdx.graphics.getDisplayModes() ) : " + Arrays.toString(displayModesForMonitor));
  Gdx.app.log("DisplayModeTest",
    "Display mode (using Gdx.graphics.getDisplayModes(Gdx.graphics.getMonitor()) ): " + displayModeForMonitor);
  assertDisplayModeEquals(displayMode, displayModeForMonitor);
  assertDisplayModesEquals(displayModes, displayModesForMonitor);
}

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

@Override
public void create () {
  batch = new SpriteBatch();
  font = new BitmapFont();
  tex = new Texture(Gdx.files.internal("data/badlogic.jpg"));
  DisplayMode[] modes = Gdx.graphics.getDisplayModes();
  for (DisplayMode mode : modes) {
    System.out.println(mode);
  }
  Gdx.app.log("FullscreenTest", Gdx.graphics.getBufferFormat().toString());
}

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

} else {
  DisplayMode m = null;
  for(DisplayMode mode: Gdx.graphics.getDisplayModes()) {
    if(m == null) {
      m = mode;

代码示例来源:origin: konsoletyper/teavm-libgdx

@Override
  public boolean keyUp (int keycode) {
    if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
      if (!Gdx.graphics.isFullscreen()) Gdx.graphics.setDisplayMode(Gdx.graphics.getDisplayModes()[0]);
    }
    return true;
  }
});

代码示例来源:origin: com.github.nifty-gui/nifty-examples-libgdx-core

private void populateResolutions() {
 resolutions = new Array();
 current = new Resolution(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
 resolutions.add(current);
 for (DisplayMode displayMode : Gdx.graphics.getDisplayModes()) {
  Resolution temp = new Resolution(displayMode.width, displayMode.height);
  if (! resolutions.contains(temp, false)) resolutions.add(temp);
 }
}

代码示例来源:origin: langurmonkey/gaiasky

DisplayMode[] modes = Gdx.graphics.getDisplayModes(m);

代码示例来源:origin: langurmonkey/gaiasky

Array<DisplayMode> modes = new Array<DisplayMode>(Gdx.graphics.getDisplayModes());
modes.sort(new Comparator<DisplayMode>() {

相关文章