public void clear() { for (TextureItem t = mTexture; t != null; t = t.dispose()) ; mAtlas.clear(); items = null; // mTexture.bitmap.eraseColor(Color.TRANSPARENT); mTexture = pool.get(); mCanvas.setBitmap(mTexture.bitmap); }
public Sprite addItem(T item, int width, int height) { Rect r = mAtlas.getRegion(width, height); if (r == null) { // create new atlas return null; } Sprite sprite = new Sprite(item, mAtlas, r); items = Inlist.appendItem(items, sprite); draw(item, r); return sprite; }