I am trying to make a 16 bit style RPG in android using andengine, but I am encountering a major hurdle: the pixels always seem deformed and out of proportion(not squares). This is an issue for text and sprites. Here are the links to the forums that have my issues http://www.andengine.org/forums/post37364.html#p37364 , http://www.andengine.org/forums/post35921.html#p35921 . I am using Nearest as the texture option for both the text and the sprites. My sprites are accessed via texture packer and my text is created using code similar to below
final ITexture mFontInfoTexture = new BitmapTextureAtlas(pContext.getTextureManager(), 256, 256, TextureOptions.NEAREST);
mFontInfo = FontFactory.createFromAsset(pContext.getFontManager(), mFontInfoTexture, pContext.getAssets() , "LongPixelFont.ttf", 18.0f, false, Color.BLACK);
mFontInfo.load();
I've tried scaling the sprite differently, changing the texture option to Linear, shifting the sprite position but nothing really works. Any insight would be greatly appreciated.
UPDATE 1:
This is the code I use that defines the resolution of the app.
// Initializes the Engine and sets the height and width.
MainActivity.mMainCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
//Sets the engine options
EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), MainActivity.mMainCamera);
//Forces the screen to go into landscape
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
UPDATE 2:
It seems that the deformation is caused by scaling(for the sprites). I did not notice any deformation when scaling by an int, but when scaling by a fraction there was some deformation. The deformation became more noticeable when scaling by an odd decimal (ie 2.5). It also seems that there is a range where the pixels will look deformed. In my case anything less than 2x will look deformed, but any int above 2 looks fine.