Пример #1
0
 public ItemSprite view(int image, Glowing glowing) {
   frame(film.get(image));
   if ((this.glowing = glowing) == null) {
     resetColor();
   }
   return this;
 }
  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()));
  }
Пример #3
0
  @Override
  protected void layout() {
    clear();

    SparseArray<Image> newIcons = new SparseArray<Image>();

    for (Buff buff : ch.buffs()) {
      int icon = buff.icon();
      if (icon != NONE) {
        Image img = new Image(texture);
        img.frame(film.get(icon));
        img.x = x + members.size() * (SIZE + 2);
        img.y = y;
        add(img);

        newIcons.put(icon, img);
      }
    }

    for (Integer key : icons.keyArray()) {
      if (newIcons.get(key) == null) {
        Image icon = icons.get(key);
        icon.origin.set(SIZE / 2);
        add(icon);
        add(
            new AlphaTweener(icon, 0, 0.6f) {
              @Override
              protected void updateValues(float progress) {
                super.updateValues(progress);
                image.scale.set(1 + 5 * progress);
              };
            });
      }
    }

    icons = newIcons;
  }