当前位置: 首页>>代码示例>>Java>>正文


Java ScreenOrientation.PORTRAIT_FIXED属性代码示例

本文整理汇总了Java中org.andengine.engine.options.ScreenOrientation.PORTRAIT_FIXED属性的典型用法代码示例。如果您正苦于以下问题:Java ScreenOrientation.PORTRAIT_FIXED属性的具体用法?Java ScreenOrientation.PORTRAIT_FIXED怎么用?Java ScreenOrientation.PORTRAIT_FIXED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.andengine.engine.options.ScreenOrientation的用法示例。


在下文中一共展示了ScreenOrientation.PORTRAIT_FIXED属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {

	final DisplayMetrics displayMetrics = new DisplayMetrics();
	WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
	wm.getDefaultDisplay().getMetrics(displayMetrics);
	wm.getDefaultDisplay().getRotation();
	
	//画面のサイズから縦横を取得する
	CAMERA_WIDTH = displayMetrics.widthPixels;
	CAMERA_HEIGHT = displayMetrics.heightPixels;
	
	this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

	return new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED,
			new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
			this.mCamera);
}
 
开发者ID:yameguun,项目名称:livewallpaper_sample,代码行数:18,代码来源:LiveWallpaperService.java

示例2: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
    Camera camera = new Camera(0,0,WORLD_WIDTH,WORLD_HEIGHT);
    EngineOptions engineOptions = new EngineOptions(true,ScreenOrientation.PORTRAIT_FIXED,new RatioResolutionPolicy(WORLD_WIDTH, WORLD_HEIGHT),camera);
    //engineOptions.getRenderOptions().setDithering(true);
    engineOptions.getAudioOptions().setNeedsMusic(true);
    engineOptions.getAudioOptions().setNeedsSound(true);
    return engineOptions;
}
 
开发者ID:viniciusDSL,项目名称:One-Cachito,代码行数:9,代码来源:GameActivity.java

示例3: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
    Point size = new Point();
    if (Build.VERSION.SDK_INT >= 17) {
        getWindowManager().getDefaultDisplay().getRealSize(size);
    } else {
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
        size.x = displayMetrics.widthPixels;
        size.y = displayMetrics.heightPixels;
    }

    float desiredRatio = (float) (1080.0 / 1920.0);
    final float realRatio = size.x / size.y;

    int measuredWidth;
    int measuredHeight;
    if (realRatio < desiredRatio) {
        measuredWidth = size.x;
        measuredHeight = Math.round(measuredWidth / desiredRatio);
    } else {
        measuredHeight = size.y;
        measuredWidth = Math.round(measuredHeight * desiredRatio);
    }

    _scale = measuredWidth / 1080.0f;

    _cameraWidth = measuredWidth;
    _cameraHeight = measuredHeight;

    return new EngineOptions(
            true,
            ScreenOrientation.PORTRAIT_FIXED,
            new RatioResolutionPolicy(1080, 1920),
            new Camera(0, 0, _cameraWidth, _cameraHeight));
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:35,代码来源:FlipGameActivity.java

示例4: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
	this.camera = new Camera(0, 0, Constants.width, Constants.height);
	SQLiteDatabaseAdapter.setContext(this);
	final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(Constants.width, Constants.height), this.camera);
	engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
	return engineOptions;
}
 
开发者ID:thoinv,项目名称:kaorisan,代码行数:8,代码来源:GameActivity.java

示例5: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {

    camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
    engineOptions.getAudioOptions().setNeedsMusic(true);

    return engineOptions;
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:11,代码来源:GameActivity.java

示例6: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
	
	prefs = PreferenceManager.getDefaultSharedPreferences(this);
	camera = new FollowCamera(0, 0, Constants.CW, Constants.CH);
	IResolutionPolicy resolutionPolicy = new FillResolutionPolicy();
	EngineOptions engineOptions = new EngineOptions(true,
			ScreenOrientation.PORTRAIT_FIXED, resolutionPolicy, camera);
	engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
	engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
	return engineOptions;
}
 
开发者ID:sm4,项目名称:FlyingDandelion,代码行数:12,代码来源:GameActivity.java

示例7: onCreateEngineOptions

public EngineOptions onCreateEngineOptions()
{

camara = new Camera(0, 0,  480,800);// Pantalla fullHD? Mala suerte...
   EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(480,800), this.camara);
   // la RatioResolutionPolicy se encarga de añadir márgenes si fuese necesario para que  la escena  mantenga las proporciones.
  
   //necesitamos sonido, internamente inicializa el player
   engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
   engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON); // que no se apaque la pantalla cuando estamos  jugando.
   return engineOptions;
}
 
开发者ID:sprayz,项目名称:Phytris,代码行数:12,代码来源:MainActivity.java

示例8: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
    CAMERA_WIDTH = getScreenWidth(this, CAMERA_HEIGHT);
    mRightOffset = (CAMERA_WIDTH * GameScene.RACE_TRACK_WIDTH) / 2f + 20f;

    mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT) {

        float offsetY = 0;
        float lastPositionY = 0;

        @Override
        public void onUpdate(float pSecondsElapsed) {
            final float speed = getSpeed();

            switch (mCurrentGameState) {
                case GAME_STATE_DEFAULT:
                    mCameraYPosition -= speed;
                    scrollBackground(lastPositionY, offsetY);
                    autoPlay(speed);
                    break;
                case GAME_STATE_RUNNING:
                    mCameraYPosition -= speed;
                    scrollBackground(lastPositionY, offsetY);
                    play(speed);
                    break;
                case GAME_STATE_DYING:

                    break;
                case GAME_STATE_PAUSED:

                    break;
                case GAME_STATE_LOADING:
                    startGame(true);
                    break;
                case GAME_STATE_WAITING:
                    break;
                default:
                    break;
            }

            super.onUpdate(pSecondsElapsed);
        }
    };

    EngineOptions mEngineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
    mEngineOptions.getAudioOptions().setNeedsMusic(true);
    mEngineOptions.getAudioOptions().setNeedsSound(true);

    return mEngineOptions;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:50,代码来源:GameActivity.java

示例9: onCreateEngineOptions

@Override
public EngineOptions onCreateEngineOptions() {
    mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    return new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
}
 
开发者ID:andreiverdes,项目名称:flappybird,代码行数:5,代码来源:GameActivity.java


注:本文中的org.andengine.engine.options.ScreenOrientation.PORTRAIT_FIXED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。