本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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));
}
}
示例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();
}
示例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());
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}