AndEngine
AndEngine copied to clipboard
RatioResolutionPolicy not working as expected?
Im developing a Live Wallpaper while Im improving my understanding of game development and Andengine. As I know RatioResolutionPolicy is meant to keep the resolution in the specified ratio. However, in my case I can still see stretching despite I use the ratiopolicy.
The device that I use has a resolution of 480x800 For the sake of experiment, I loaded a texture which is 200x600 and I set the camera as 200x600 RatioResolutionPolicy(200, 600) It resulted as if a fillresolution policy has been set, i expected to see some black bars actually. Possibly there is something I missed, but couldnt figure that out.
Sounds like a bug. Can you post your sample code so we can verify?
Basiclly my service class
public class IstService extends BaseLiveWallpaperService {
private Camera mCamera;
private Scene mScene;
@Override
public EngineOptions onCreateEngineOptions() {
mCamera = new Camera(0, 0, 200, 600);
EngineOptions engineOptions = new EngineOptions(true,
ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(200, 600), mCamera);
return engineOptions;
}
@Override
public void onCreateResources(
OnCreateResourcesCallback pOnCreateResourcesCallback)
throws Exception {
ResourceManager.getInstance().loadTextureData(mEngine, this);
pOnCreateResourcesCallback.onCreateResourcesFinished();
}
@Override
public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback)
throws Exception {
mScene = new Scene();
pOnCreateSceneCallback.onCreateSceneFinished(mScene);
}
@Override
public void onPopulateScene(Scene pScene,
OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {
Sprite background = new Sprite(0, 0, ResourceManager.getInstance().mKizKulesiRegion,
this.getVertexBufferObjectManager());
mScene.attachChild(background);
pOnPopulateSceneCallback.onPopulateSceneFinished();
}
}
and I load the texture via a Resoruce Manager, that texture's resolution is 200x600