
I am facing 2 problems.
Questions are listed in picture above.
And main code snippets like this:
My device has a 1024×600 resolution.
Engine:
this.mCamera = new Camera(0, 0,*device'width*,*device'height*);
final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), this.mCamera);
engineOptions.getTouchOptions().setNeedsMultiTouch(true);
Background:
BitmapTextureAtlas bta = new BitmapTextureAtlas(mGame.getTextureManager(),WIDTH_SCENE_PNG,HEIGHT_SCENE_PNG, TextureOptions.BILINEAR);
ITextureRegion it = BitmapTextureAtlasTextureRegionFactory.createFromResource(bta, mGame, R.drawable.bg_main, 0, 0);
bta.load();
final Sprite sprite = new Sprite(0, 0,*device'width*,*device'height*,it, mGame.getVertexBufferObjectManager());
SpriteBackground bg = new SpriteBackground(sprite);
bg.setColor(Color.PINK);
setBackground(bg);
Sprites:
BitmapTextureAtlas btaTools = new BitmapTextureAtlas(mGame.getTextureManager(), 30, 40);
ITextureRegion itDelete = BitmapTextureAtlasTextureRegionFactory.createFromResource(btaTools, c, R.drawable.sprite_delete,0,0);
btaTools.load();
I fixed my problem.
The point is that I moved my resources(png images) from project’s drawable-hdpi folder to drawable foler, sprites look nice then.
raw or asset folders are also OK.
Your answer is also helpful for me.Thank you! @Christoph