我得到了一個額外的線條(即1像素)以及TextureRegions。這裏是我製作textureRegions的代碼。我也嘗試在紋理區域之間提供1像素的填充,但它不起作用。我的圖像的大小是132x24。在AndEngine中沿紋理區域獲取額外線條(Android)
this.txAt_Paddles = new BitmapTextureAtlas(512, 64,TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.txRg_paddle_left = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.txAt_Paddles, this, "paddle_left.png", 0,0);
this.txRg_paddle_right = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.txAt_Paddles, this, "paddle_right.png", 0,24);
this.mEngine.getTextureManager().loadTexture(this.txAt_Paddles);
任何人都可以指出爲什麼我在不同的紋理區域的不同邊上得到這些線。這些線不在TextureRegions的所有邊上。
我嘗試了這篇文章中的代碼,但仍然隨機獲取線條。 – Khawar
查看另一種技術的鏈接。 Whalabi用透明png加載了整個紋理,然後在其上加載了所有的東西。也爲我工作,我喜歡它比擴展TextureFactory更好。 – jmcdale
謝謝,我試過Whalabi的想法,它爲我工作。 – Khawar