Пытается использовать andengine для загрузки спрайта, но нижняя и правая стороны спрайта обрезаются.Справа Andengine GLES2 обрезается снизу и справа
Код:
/*
* Create the bitmap texture atlas for the sprite's texture region
*/
BuildableBitmapTextureAtlas mBitmapTextureAtlas = new BuildableBitmapTextureAtlas(
mEngine.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
/*
* Create the sprite's texture region via the
* BitmapTextureAtlasTextureRegionFactory
*/
mSpriteTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromResource(
mBitmapTextureAtlas, c, getSpriteId());
/* Build the bitmap texture atlas */
try
{
mBitmapTextureAtlas
.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
0, 1, 1));
}
catch (TextureAtlasBuilderException e)
{
e.printStackTrace();
}
/*
* Load the bitmap texture atlas into the device's gpu memory
*/
mBitmapTextureAtlas.load();
mSprite = new Sprite(getInitialX(), getInitialY(), mSpriteTextureRegion,
engine.getVertexBufferObjectManager());
/* Attach the marble to the Scene */
scene.attachChild(mSprite);
Удивительный, что исправил его. Я предполагаю, что это означает, что теперь мне нужно управлять масштабированием DPI/sprite вручную? –
Рад, что сработало! И ответить на вопрос о управлении масштабированием DPI/sprite. Ответ - да. С различными типами ResolutionPolicy у вас есть набор инструментов. Там много написано по теме о вас. Сколько работы, которую вы хотите внести в нее, будет зависеть от вашего проекта. –