當前位置: 首頁>>代碼示例>>Java>>正文


Java FPSLogger類代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.FPSLogger的典型用法代碼示例。如果您正苦於以下問題:Java FPSLogger類的具體用法?Java FPSLogger怎麽用?Java FPSLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FPSLogger類屬於com.badlogic.gdx.graphics包,在下文中一共展示了FPSLogger類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: show

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:UdealInferno,項目名稱:Parasites-of-HellSpace,代碼行數:27,代碼來源:GameScreen.java

示例2: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:blueacorn,項目名稱:libgdx-spriter-demo,代碼行數:20,代碼來源:MyGdxSpriterGame.java

示例3: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:Motsai,項目名稱:neblina-libgdx3d,代碼行數:25,代碼來源:Invaders.java

示例4: onInitialize

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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;
}
 
開發者ID:macbury,項目名稱:ForgE,代碼行數:20,代碼來源:LoadingScreen.java

示例5: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:konsoletyper,項目名稱:teavm-libgdx,代碼行數:25,代碼來源:Invaders.java

示例6: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:22,代碼來源:AnimationTest.java

示例7: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:macbury,項目名稱:BotLogic,代碼行數:26,代碼來源:GameManager.java

示例8: World

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:Nerzal,項目名稱:Castle-Invaders,代碼行數:23,代碼來源:World.java

示例9: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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));
	}

}
 
開發者ID:MATheCoder,項目名稱:QwikGDX,代碼行數:19,代碼來源:MyGdxGame.java

示例10: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:jadref,項目名稱:buffer_bci,代碼行數:25,代碼來源:Invaders.java

示例11: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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());
}
 
開發者ID:Xesenix,項目名稱:libgdx-template-project,代碼行數:23,代碼來源:XesEffects.java

示例12: show

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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);
}
 
開發者ID:jwang47,項目名稱:radial,代碼行數:18,代碼來源:GameScreen.java

示例13: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:Drusy,項目名稱:Wisper,代碼行數:22,代碼來源:WisperGame.java

示例14: create

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
@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();
}
 
開發者ID:silconsystem,項目名稱:Gensokyo_LibGdx,代碼行數:27,代碼來源:GensokyoGame.java

示例15: GameScreen

import com.badlogic.gdx.graphics.FPSLogger; //導入依賴的package包/類
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();
}
 
開發者ID:DurianHLN,項目名稱:Polymorph,代碼行數:11,代碼來源:GameScreen.java


注:本文中的com.badlogic.gdx.graphics.FPSLogger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。