2014-12-07 7 views
0

Ниже приведены полные коды программы. Когда я запускаю программу в BlueStacks, появился черный экран. Драйвер моей видеокарты работает нормально и обновляется. Пожалуйста, помогите мне найти проблему.Черный экран в синем Стеки при запуске программы AndEngine

public class StartActivity extends BaseGameActivity { 

private static final int CAMERA_WIDTH = 800; 
private static final int CAMERA_HEIGHT = 480; 

private Camera mCamera; 
private Texture mTexture; 
private TextureRegion mSplashTextureRegion; 

    @Override 
public Engine onLoadEngine() { 
    this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); 
    return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera)); 
} 

@Override 
public void onLoadResources() { 
    this.mTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
    this.mSplashTextureRegion = TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/Splashscreen.png", 0, 0); 

    this.mEngine.getTextureManager().loadTexture(this.mTexture); 
} 

@Override 
public Scene onLoadScene() { 
    this.mEngine.registerUpdateHandler(new FPSLogger()); 

    final Scene scene = new Scene(1); 

    /* Center the splash on the camera. */ 
    final int centerX = (CAMERA_WIDTH - this.mSplashTextureRegion.getWidth())/2; 
    final int centerY = (CAMERA_HEIGHT - this.mSplashTextureRegion.getHeight())/2; 

    /* Create the sprite and add it to the scene. */ 
    final Sprite splash = new Sprite(centerX, centerY, this.mSplashTextureRegion); 
    scene.getLastChild().attachChild(splash); 

    return scene; 
} 

@Override 
public void onLoadComplete() { 
} 
} 
+0

я надеюсь, что кто-то может помочь мне об этой проблеме – 007

+0

Существует любая ошибка в LogCat? – ranifisch

+0

В Logcat нет ошибок. я не могу понять, почему эта проблема возникает – 007

ответ

0

Какое разрешение изображения? если выше, чем 512 * 512, то вам необходимо изменить эту строку:

this.mTexture = new Texture(1024, 10244, TextureOptions.BILINEAR_PREMULTIPLYALPHA);