예제 #1
0
  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);
  }
예제 #2
0
  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;
  }