@Override
  protected void createChildren() {
    bg = new Image(TextureCache.createSolid(0xFFcc0000));
    bg.scale.y = HEIGHT;
    add(bg);

    level = new Image(TextureCache.createSolid(0xFF00cc00));
    level.scale.y = HEIGHT;
    add(level);
  }
  public static TextureFilm tiers() {
    if (tiers == null) {
      SmartTexture texture = TextureCache.get(Assets.ROGUE);
      tiers = new TextureFilm(texture, texture.width, FRAME_HEIGHT);
    }

    return tiers;
  }
Example #3
0
  public static int pick(int index, int x, int y) {
    Bitmap bmp = TextureCache.get(Assets.ITEMS).bitmap;
    int rows = bmp.getWidth() / SIZE;
    int row = index / rows;
    int col = index % rows;

    // FIXME: I'm assuming this is super slow?
    final TextureData td = bmp.getTextureData();
    if (!td.isPrepared()) {
      td.prepare();
    }
    final Pixmap pixmap = td.consumePixmap();
    int pixel = pixmap.getPixel(col * SIZE + x, row * SIZE + y);
    pixmap.dispose();
    return pixel;
  }
  public WndInfoBuff(Buff buff) {
    super();

    IconTitle titlebar = new IconTitle();

    icons = TextureCache.get(Assets.BUFFS_LARGE);
    film = new TextureFilm(icons, 16, 16);

    Image buffIcon = new Image(icons);
    buffIcon.frame(film.get(buff.icon()));

    titlebar.icon(buffIcon);
    titlebar.label(Messages.titleCase(buff.toString()), Window.TITLE_COLOR);
    titlebar.setRect(0, 0, WIDTH, 0);
    add(titlebar);

    RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
    txtInfo.maxWidth(WIDTH);
    txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
    add(txtInfo);

    resize(WIDTH, (int) (txtInfo.top() + txtInfo.height()));
  }
 public FogTexture() {
   super(Bitmap.createBitmap(width2, height2, Bitmap.Config.ARGB_8888));
   filter(Texture.LINEAR, Texture.LINEAR);
   TextureCache.add(FogOfWar.class, this);
 }
 @Override
 protected void createChildren() {
   texture = TextureCache.get(Assets.BUFFS_SMALL);
   film = new TextureFilm(texture, SIZE, SIZE);
 }