Я занимаюсь программированием Android с AndEngine и сталкивался с какой-то странностью с Hashtables.Java Hashtable с AndEngine
в основном, если я это сделать:
BitmapTextureAtlas m_textureAtlas = new BitmapTextureAtlas(p_baseActivity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
TextureRegion texture1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(m_textureAtlas, p_baseActivity, "Chrysanthemum.jpg", 0, 0);
m_textureAtlas.load();
Sprite m_sprite1 = new Sprite(0, 0, texture1, p_baseActivity.getEngine().getVertexBufferObjectManager());
this.attachChild(m_sprite1);
Everything слово мелкого. Но если я это сделаю:
BitmapTextureAtlas m_textureAtlas = new BitmapTextureAtlas(p_baseActivity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
Hashtable<String, TextureRegion> test = new Hashtable<String, TextureRegion>();
TextureRegion texture1 = test.put("1", BitmapTextureAtlasTextureRegionFactory.createFromAsset(m_textureAtlas, p_baseActivity, "Chrysanthemum.jpg", 0, 0));
m_textureAtlas.load();
Sprite m_sprite1 = new Sprite(0, 0, texture1, p_baseActivity.getEngine().getVertexBufferObjectManager());
this.attachChild(m_sprite1);
Это (изображение) мерцает, а размеры - все неправильно. Прямо сейчас я в порядке с первым набором кода для этого проекта, но я не уверен, что я делаю что-то неправильно или я должен просто избегать возвращаемого значения put() вообще.
owww Я вижу! большое спасибо. –