home

2014년 8월 15일 금요일

[AndEngine] 6. scroll image.

onCreateResources() {
    this.mAutoParallaxBackgroundTexture = new BitmapTextureAtlas(
            this.getTextureManager(), 800, 480);
...
}

onCreateScene() {
    ....
    final AutoParallaxBackground autoParallaxBackground = 
            new AutoParallaxBackround(0, 0, 0, 5);
    final VertexBufferObjectManager vertexBufferObjectManager = 
            this.getVertexBufferObjectManager();

    final ParallaxEntity bEntity = new ParallaxEntity(+2.0f,
            new Sprite(0, CAMERA_HEIGHT - this.mParallaxLayerBack.getHeight(),
            this.mParallaxLayerBack, vertexBufferObjectManager));
    autoParallaxBackground.attachParallaxEntity(bEntity);
    scene.setBackground(autoParallaxBackground);

    return scene;
}

댓글 없음:

댓글 쓰기