Java 类com.badlogic.gdx.graphics.FPSLogger 实例源码

项目:Parasites-of-HellSpace    文件:GameScreen.java   
@Override
public void show() 
{
    fpsLogger = new FPSLogger();

    batch = new SpriteBatch();
    camera = new OrthographicCamera(500, 800);
    viewport = new FitViewport(500, 800, camera);
    player = new Player();
    player.create();

    background = new Background();
    background.create();

    spawningFactory = new SpawningFactory();
    spawningFactory.create();

    spawningEnemy = new SpawningEnemy();
    spawningEnemy.create();

    spawningBullet = new SpawningBullet();
    spawningBullet.create();

    ui = new UI();
    ui.create();
}
项目:libgdx-spriter-demo    文件:MyGdxSpriterGame.java   
@Override
public void create() {
    super.create();

    cam = new OrthographicCamera();
    cam.zoom = 1f;
    renderer = new ShapeRenderer();
    batch = new SpriteBatch();
    FileHandle handle = Gdx.files.internal("monster/basic_002.scml");
    Data data = new SCMLReader(handle.read()).getData();

    loader = new LibGdxLoader(data);
    loader.load(handle.file());

    drawer = new LibGdxDrawer(loader, batch, renderer);

    player = new Player(data.getEntity(0));
    fpslog = new FPSLogger();
}
项目:neblina-libgdx3d    文件:Invaders.java   
@Override
public void create () {
    Array<Controller> controllers = Controllers.getControllers();
    if (controllers.size > 0) {
        controller = controllers.first();
    }
    Controllers.addListener(controllerListener);

    setScreen(new MainMenu(this));
    music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3", FileType.Internal));
    music.setLooping(true);
    music.play();
    Gdx.input.setInputProcessor(new InputAdapter() {
        @Override
        public boolean keyUp (int keycode) {
            if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
                Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
            }
            return true;
        }
    });

    fps = new FPSLogger();
}
项目:ForgE    文件:LoadingScreen.java   
@Override
protected void onInitialize() {
  this.shapeRenderer = new ShapeRenderer();
  this.camera        = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  this.fpsLogger     = new FPSLogger();
  this.promiseTicker = new GdxPromiseFrameTicker();
  this.boxTransMat   = new Matrix4();

  camera.position.set(0, 8, 0);
  camera.lookAt(Vector3.Zero);
  ForgE.log(TAG, "Preparing to load: " + teleport.mapId);
  AsyncLevelLoader loader                 = new AsyncLevelLoader();
  GeometryBuilderTask geometryBuilderTask = new GeometryBuilderTask(promiseTicker);
  loader.then(geometryBuilderTask);
  geometryBuilderTask.then(new LevelAssetsLoaderTask(promiseTicker)).then(this);
  loader.execute(teleport.mapId);

  this.indicatorRotation = 0f;
}
项目:teavm-libgdx    文件:Invaders.java   
@Override
public void create () {
    Array<Controller> controllers = Controllers.getControllers();
    if (controllers.size > 0) {
        controller = controllers.first();
    }
    Controllers.addListener(controllerListener);

    setScreen(new MainMenu(this));
    music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3", FileType.Internal));
    music.setLooping(true);
    music.play();
    Gdx.input.setInputProcessor(new InputAdapter() {
        @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;
        }
    });

    fps = new FPSLogger();
}
项目:libgdxcn    文件:AnimationTest.java   
@Override
public void create () {
    texture = new Texture(Gdx.files.internal("data/walkanim.png"));
    TextureRegion[] leftWalkFrames = TextureRegion.split(texture, 64, 64)[0];
    TextureRegion[] rightWalkFrames = new TextureRegion[leftWalkFrames.length];
    for (int i = 0; i < rightWalkFrames.length; i++) {
        TextureRegion frame = new TextureRegion(leftWalkFrames[i]);
        frame.flip(true, false);
        rightWalkFrames[i] = frame;
    }
    leftWalk = new Animation(0.25f, leftWalkFrames);
    rightWalk = new Animation(0.25f, rightWalkFrames);

    cavemen = new Caveman[100];
    for (int i = 0; i < 100; i++) {
        cavemen[i] = new Caveman((float)Math.random() * Gdx.graphics.getWidth(),
            (float)Math.random() * Gdx.graphics.getHeight(), Math.random() > 0.5 ? true : false);
    }
    batch = new SpriteBatch();
    fpsLog = new FPSLogger();
}
项目:BotLogic    文件:GameManager.java   
@Override
public void create() {
  Gdx.app.log(TAG, "created");

  Tween.registerAccessor(ModelEntity.class, new ModelEntityAccessor());
  Tween.registerAccessor(RTSCameraController.class, new CameraAccessor());
  Tween.registerAccessor(RobotEntity.class, new RobotEntityAccessor());
  ContextFactory.initGlobal(new ScriptContextFactory());

  BotLogic.game         = this;
  BotLogic.inputManager = new InputManager();
  BotLogic.audio        = new AudioManager();
  BotLogic.skin         = new FlatSkin();
  BotLogic.models       = new ModelManager();
  BotLogic.sprites      = new SpritesManager();
  BotLogic.entities     = new EntityManager();
  BotLogic.config       = new ConfigManager();

  BotLogic.screens      = new ScreenManager(this);// always last!!!
  BotLogic.config.load();
  loading = false;
  fpsLogger = new FPSLogger();

  BotLogic.screens.goToMainMenu();
}
项目:Castle-Invaders    文件:World.java   
/**
 * Initialises the World -> Creates a new Array for Trolls (own Mobs) and
 * another list for enemy mobs, creates a timer, fps counter and random()
 * **/
public World(int level) {
    mobs = new Array<GameLiving>();
    enemyEntities = new Array<GameLiving>();
    spells = new Array<Spells>();
    projectiles = new Array<Projectile>();

    this.timer = new Timer();
    this.fps = new FPSLogger();
    this.random = new Random();
    this.level = level;

    enemyCounter = 0;
    maxEnemies = level * 6;
    spawnTimer = 2;
    wave = 1;
    World.levelEnd = false;
    // this.debug = false;
}
项目:libgdx-demo-invaders    文件:Invaders.java   
@Override
public void create () {
    Array<Controller> controllers = Controllers.getControllers();
    if (controllers.size > 0) {
        controller = controllers.first();
    }
    Controllers.addListener(controllerListener);

    setScreen(new MainMenu(this));
    music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3", FileType.Internal));
    music.setLooping(true);
    music.play();
    Gdx.input.setInputProcessor(new InputAdapter() {
        @Override
        public boolean keyUp (int keycode) {
            if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
                Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
            }
            return true;
        }
    });

    fps = new FPSLogger();
}
项目:QwikGDX    文件:MyGdxGame.java   
@Override
public void create() {
    log = new FPSLogger();
    Scanner scanner = new Scanner(System.in);
    System.out.print("Enter Screen id 0-3: ");
    int answer = scanner.nextInt();

    if (answer == 0) {
        setScreen(new MainGameScreen(this));
    } else if (answer == 1) {
        setScreen(new CollisionTest(this));
    } else if (answer == 2) {
        setScreen(new PhysicsScreenTest(this));
    } else if (answer == 3) {
        setScreen(new AnimationTest(this));
    }

}
项目:buffer_bci    文件:Invaders.java   
@Override
public void create () {
    Array<Controller> controllers = Controllers.getControllers();
    if (controllers.size > 0) {
        controller = controllers.first();
    }
    Controllers.addListener(controllerListener);

    setScreen(new MainMenu(this));
    music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3", FileType.Internal));
    music.setLooping(true);
    music.play();
    Gdx.input.setInputProcessor(new InputAdapter() {
        @Override
        public boolean keyUp (int keycode) {
            if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
                if (!Gdx.graphics.isFullscreen()) Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayModes()[0]);
            }
            return true;
        }
    });

    fps = new FPSLogger();
}
项目:libgdx-template-project    文件:XesEffects.java   
@Override
public void create()
{
    Gdx.app.log(XesEffects.LOG, "Creating game object..");

    this.fpsLogger = new FPSLogger();
    this.tweenManager = new TweenManager();

    Tween.setCombinedAttributesLimit(4);
    Tween.registerAccessor(Color.class, new ColorAccessor());

    this.skin = new Skin(Gdx.files.internal("ui/uiskin.json"));

    int index = 1;
    this.effectsCollection = new ScreenFactory<EffectScreenConfig>(this);
    this.effectsCollection.add(
        (new EffectScreenConfig(String.format("Effect %d", index++), EffectScreen.class))
        .setTitle("Test subject number 1")
    );

    this.setScreen(this.getSplashScreen());
}
项目:radial    文件:GameScreen.java   
@Override
public void show() {
  fpsLogger = new FPSLogger();
  timer = new Timer();

  float maxAspectRatio = 16.0f / 9.0f;
  float worldEdgeLength = 100.0f;
  Viewport viewport = new ExtendViewport(worldEdgeLength, worldEdgeLength,
                                         worldEdgeLength * maxAspectRatio, worldEdgeLength);

  context = new Context(viewport);
  context.create();
  context.activate();

  // debug grid
  grid = new Grid2D(context);
}
项目:Wisper    文件:WisperGame.java   
@Override
public void create () {
       // Preferences
       preferences = Gdx.app.getPreferences(Config.GAME_NAME);

       // Fps
       fps = new FPSLogger();

       // Camera
       MultipleVirtualViewportBuilder = new MultipleVirtualViewportBuilder(
               Config.APP_WIDTH, Config.APP_HEIGHT,
               Config.APP_WIDTH, Config.APP_HEIGHT);
       VirtualViewport = MultipleVirtualViewportBuilder.getVirtualViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
       Camera = new OrthographicCameraWithVirtualViewport(VirtualViewport);

       // Loader
       loader = new LoadingScreen(this);
       loader.setNextScreen(new MainMenu());

       Debug.PrintDebugInformation();
}
项目:Gensokyo_LibGdx    文件:GensokyoGame.java   
@Override
public void create()
{                           
    Gdx.app.log(GensokyoGame.LOG, "Creating the game");
    fpslogger = new FPSLogger();

    // create the preferences manager
    preferencesManager = new PreferencesManager();

    // create music manager
    audioManager = new AudioManager();
    audioManager.setVolume(preferencesManager.getVolume());
    audioManager.setEnabled(preferencesManager.isMusicEnabled());

    // create the sound effects manager
    audioEffectsManager = new AudioFxManager();
    audioEffectsManager.setVolume(preferencesManager.getVolume());
    audioEffectsManager.setEnabled(preferencesManager.isSoundEnabled());

    // create the profile manager
    profileManager = new ProfileManager();
    profileManager.retrieveProfile();

    // create the level manager
    levelManager = new LevelManager();
}
项目:Polymorph    文件:GameScreen.java   
public GameScreen(Polymorph polymorph) {
    this.polymorph = polymorph;

    this.polyGame = new PolyGame(polymorph.getAssetManager().get(Polymorph.MASTER_PATH, TextureAtlas.class));
    this.fps = new FPSLogger();

    initUtils();
    initAssets();
    initHud();
}
项目:DunGen    文件:DunGen.java   
@Override
public void create () {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    Gdx.graphics.setCursor(Gdx.graphics.newCursor(new Pixmap(Gdx.files.internal("ui/cursor.png")), 0, 0));
       fpsLogger = new FPSLogger();

    MapGenerator mapGenerator = new MapGenerator();
    new Thread(mapGenerator).start();
}
项目:VuforiaLibGDX    文件:Engine.java   
@Override
public void create () {
    Display mDisplay = new Display(vuforiaRenderer);
    setScreen(mDisplay);
    vuforiaRenderer.initRendering();
    fps = new FPSLogger();
}
项目:SkiFun    文件:SkiFun.java   
@Override
public void create() {
    batcher = new SpriteBatch();
    textOverPlayers= new BitmapFont(Gdx.files.internal("data/hobo.fnt"),Gdx.files.internal("data/hobo.png"),false,false);
    Settings.load();
    Assets.load();
    // Load the TournamentsCore if we have a valid implementation of it
    if (this.tournaments != null) {
        NextpeerPlugin.load(this.tournaments);
    }
    setScreen(new MainScreen(this));
    fps = new FPSLogger();

}
项目:android-screen-recorder    文件:Invaders.java   
@Override
public void create() {
    Array<Controller> controllers = Controllers.getControllers();
    if (controllers.size > 0) {
        controller = controllers.first();
    }
    Controllers.addListener(controllerListener);

    setScreen(new MainMenu(this));
    music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3",
            FileType.Internal));
    music.setLooping(true);
    music.play();
    Gdx.input.setInputProcessor(new InputAdapter() {
        @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;
        }
    });

    fps = new FPSLogger();
}
项目:libgdxcn    文件:EdgeDetectionTest.java   
public void create () {
    ShaderProgram.pedantic = false;
    /*
     * shader = new ShaderProgram(Gdx.files.internal("data/shaders/default.vert").readString(), Gdx.files.internal(
     * "data/shaders/depthtocolor.frag").readString()); if (!shader.isCompiled()) { Gdx.app.log("EdgeDetectionTest",
     * "couldn't compile scene shader: " + shader.getLog()); }
     */
    batchShader = new ShaderProgram(Gdx.files.internal("data/shaders/batch.vert").readString(), Gdx.files.internal(
        "data/shaders/convolution.frag").readString());
    if (!batchShader.isCompiled()) {
        Gdx.app.log("EdgeDetectionTest", "couldn't compile post-processing shader: " + batchShader.getLog());
    }

    ObjLoader objLoader = new ObjLoader();
    scene = objLoader.loadObj(Gdx.files.internal("data/scene.obj"));
    sceneInstance = new ModelInstance(scene);
    modelBatch = new ModelBatch();
    fbo = new FrameBuffer(Format.RGB565, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
    cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    cam.position.set(0, 0, 10);
    cam.lookAt(0, 0, 0);
    cam.far = 30;
    batch = new SpriteBatch();
    batch.setShader(batchShader);
    fboRegion = new TextureRegion(fbo.getColorBufferTexture());
    fboRegion.flip(false, true);
    logger = new FPSLogger();
    calculateOffsets();
}
项目:tafl    文件:TaflGame.java   
@Override
public FPSLogger createFPSLogger() {
    if (Constants.GameConstants.DEBUG) {
        return new FPSLogger();
    }
    return null;
}
项目:Simple-Isometric-Game    文件:IsometricGame.java   
@Override
public void create () {
       assets = new Assets();
       log = new FPSLogger();

       this.setScreen(new LoadingScreen(this));
}
项目:Nextpeer-libgdx-Sample    文件:SuperJumper.java   
@Override
public void create () {
    Settings.load();
    Assets.load();
    setScreen(new MainMenuScreen(this));
    fps = new FPSLogger();
}
项目:Nextpeer-libgdx-Sample    文件:SuperJumper.java   
@Override
public void create () {
    Settings.load();
    Assets.load();

    setScreen(new MainMenuScreen(this));
    fps = new FPSLogger();
}
项目:Glaze    文件:App.java   
@Override
public void create() {
    Gdx.app.log(TAG, "Starting application");
    world = new World();
    physics = new Physics();
    renderer = new Renderer();
    inputProcessor = new InputProcessor();
    Gdx.input.setInputProcessor(inputProcessor);
    fpsLogger = new FPSLogger();
}
项目:runebind    文件:RuneBind.java   
@Override
public void create() {  
    Gdx.app.log(LOG, "Creating game on: " + Gdx.app.getType());

    fpsLogger = new FPSLogger();

    batch = new SpriteBatch();

    if(!DEV_MODE) {
        setScreen(getSplashScreen());
    } else {
        setScreen(new GameScreen(this));
    }
}
项目:pruebaGit1    文件:SuperJumper.java   
@Override
public void create () {
    Settings.load();
    Assets.load();
    setScreen(new MainMenuScreen(this));
    fps = new FPSLogger();
}
项目:DreamsLibGdx    文件:DreamsGame.java   
@Override
public void create() {
    Gdx.input.setCatchBackKey(true);
    resourcesManager =new ResourcesManager();
    preferencesManager = PreferencesManager.instance;
    profileManager= new ProfileManager();
    levelManager=new LevelManager(this);
    audioManager =new AudioManager(this);

    log = new FPSLogger();
    setGameState(GameState.GAME_SHOW_SPLASH);
}
项目:acid-snake    文件:IngameScreen.java   
@Override
public void show() {
    ShaderProgram.pedantic = false;
    batch = new SpriteBatch();
    tweenManager = new TweenManager();
    fpsLogger = new FPSLogger();
    final int VERTICAL_INDEX = 18;
    final int CELL_SIZE = (int) ((Gdx.graphics.getHeight()) / VERTICAL_INDEX);
    final int HORIZONTAL_INDEX = (int) (Gdx.graphics.getWidth() / CELL_SIZE);
    world = new SimpleWorld(HORIZONTAL_INDEX, VERTICAL_INDEX);
    bufferedRenderer = new GdxBufferedRenderer();

       acid = new Acid(HORIZONTAL_INDEX, VERTICAL_INDEX, CELL_SIZE, bufferedRenderer);
       acid.setPosition(Gdx.graphics.getWidth() / 2f - acid.getWidth() / 2f, 
                           (Gdx.graphics.getHeight()) / 2f - acid.getHeight() / 2f);
       acid.setPadding(1);
       Resources.reloadCellRenderer((GdxBufferedRenderer) acid.getBufferedRenderer());


       Snake snake = world.getSnake();

       worldRenderer = new WorldRenderer(acid);
       world.addListener(worldRenderer);
       achievementManager = new ArchievementManager(world, game.getGoogleInterface());
    snake.addListener(achievementManager);
    world.getPlayer().addListener(achievementManager);
       world.build();
       //world.getSnake().addListener(new WorldDebugger(world));
       particleRenderer = new ParticleRenderer(acid, world);
       world.getPlayer().addListener(particleRenderer);
       world.getSnake().addListener(particleRenderer);
       world.addListener(particleRenderer);
}
项目:TopDown    文件:TopDown.java   
@Override
public void create () {
    batch = new SpriteBatch();
    font = new BitmapFont();
    SinCosTable.init();
    ResourceHandler.initResourceHandler();

    cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    cam.setToOrtho(false);

    Zombie.animId = ResourceHandler.createAnimation("Zombie.png", 8, 0, 0, 60, 60);
    Bullet.regId = ResourceHandler.createRegion("atlas.png", 149, 25, 2, 10);
    player = new Player(ResourceHandler.createAnimation("Soldier_atlas.png", 8, 0, 0, 60, 60),
            62, -58, 60, 60);

    input = new InputTracker();

    int[][] mapSpec = {
            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1},
            {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1},
            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
    };

    map = new TileMap(mapSpec);

    Gdx.input.setInputProcessor(input);

    manager = new ZombieManager(map);

    wave = 1;

    is = new ItemSpawner();

    log = new FPSLogger();
}
项目:ragnar    文件:DebugUtility.java   
public DebugUtility() {
    box2DRenderer = new Box2DDebugRenderer();
    fpsLogger = new FPSLogger();
    debugFields = new HashMap<String, Integer>();
    timers = new HashMap<String, Float>();
}
项目:PlanePilot    文件:Box2DLightsDemo.java   
@Override
public void create() {
    width = Gdx.graphics.getWidth();
    height = Gdx.graphics.getHeight();
    orthographicCamera = new OrthographicCamera(width, height);
    orthographicCamera.position.set(width/2f, height/2f, 0);
    orthographicCamera.update();

    world = new World(new Vector2(0, -9.8f), false);
    renderer = new Box2DDebugRenderer();

    fpsLogger = new FPSLogger();

    BodyDef circleDef = new BodyDef();
    circleDef.type = BodyDef.BodyType.DynamicBody;
    circleDef.position.set(width/2f, height/2f);

    circleBody = world.createBody(circleDef);

    CircleShape circleShape = new CircleShape();
    circleShape.setRadius(3f); // tennis bass size is perfect

    FixtureDef circleFixture = new FixtureDef();
    circleFixture.shape = circleShape;
    circleFixture.density = 0.4f;
    circleFixture.friction = 0.2f;
    circleFixture.restitution = 0.8f;

    circleBody.createFixture(circleFixture);

    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.position.set(0f, 3f);

    groundBody = world.createBody(groundBodyDef);

    PolygonShape groundShape = new PolygonShape();
    groundShape.setAsBox(orthographicCamera.viewportWidth * 2, 3f);

    groundBody.createFixture(groundShape, 0f);

    rayHandler = new RayHandler(world);
    rayHandler.setCombinedMatrix(orthographicCamera.combined);

    new PointLight(rayHandler, 2000, Color.BLUE, 1000, width/2f, height/2f);
    new PointLight(rayHandler, 2000, Color.RED, 1000, width/2f+250, height/2f-250);
}
项目:Cypher-Sydekick    文件:MainScreen.java   
public MainScreen(Level lvl) {
    this.map = lvl.map;
    this.acts = lvl.acts;
    this.parent = lvl.parent;
    this.fpsLogger = new FPSLogger();
}
项目:entity-shmup    文件:FPSConsoleLoggingSystem.java   
public FPSConsoleLoggingSystem() {
  logger = new FPSLogger();
}