Example #1
0
 public synchronized void draw(GLEx g) {
   if (isExist()) {
     int i = index;
     if (max <= i) {
       i = max - 1;
     }
     SRPGMessage mes = getMessage(i);
     if (listener != null) {
       listener.drawBackground(i, g);
     }
     if (character != null) {
       g.drawTexture(character, chara_x, chara_y);
     }
     LFont font = g.getFont();
     if (face != null) {
       int w = face.getWidth();
       int h = face.getHeight();
       int x = mes.getX();
       int y = mes.getY() - h;
       g.setColor(LColor.black);
       g.fillRect(x, y, w, h);
       g.drawTexture(face, x, y);
     }
     g.setFont(mes.getFont());
     if (background == null) {
       LGradation.getInstance(LColor.white, LColor.black, mes.getWidth(), mes.getHeight())
           .drawHeight(g, mes.getX(), mes.getY());
       g.setColor(LColor.black);
       g.drawRect(mes.getX(), mes.getY(), mes.getWidth(), mes.getHeight());
     } else {
       g.drawTexture(background, mes.getX(), mes.getY());
     }
     mes.update(delay);
     g.setColor(LColor.white);
     mes.draw(g);
     if (listener != null) {
       listener.drawForeground(i, g);
     }
     g.setFont(font);
     g.resetColor();
   }
 }
Example #2
0
 private void drawImage(GLEx g) {
   int length = shoutImg.length;
   if (length == 0) {
     return;
   }
   int activeNum = getActiveNum();
   arrayR[activeNum] = 20;
   for (int j = 0; j < number; j++) {
     arrayR[j] += 8;
     for (int i = 0; i < 20; i++) {
       g.drawTexture(shoutImg[arrayR[j] / 8 & length], getX(j, i), getY(j, i));
     }
   }
 }
Example #3
0
 @Override
 protected synchronized void createCustomUI(GLEx g, int x, int y, int w, int h) {
   if (!visible) {
     return;
   }
   LFont oldFont = g.getFont();
   g.setFont(messageFont);
   print.draw(g, fontColor);
   g.setFont(oldFont);
   if (print.isComplete() && animation != null) {
     if (animation.getSpriteImage() != null) {
       g.setAlpha(1.0F);
       updateIcon();
       g.drawTexture(animation.getSpriteImage(), dx, dy);
     }
   }
   g.resetColor();
 }
Example #4
0
 public void paint(GLEx g, Object value, int x, int y, int width, int height) {
   if (value instanceof BindIcon) {
     int size = font.getHeight() - 4;
     BindIcon icon = (BindIcon) value;
     String s = icon.name;
     s = font.confineLength(s, width - size - 4);
     int entryOffset = 4 + alignment.alignX(width - 4, font.stringWidth(s));
     g.setFont(font);
     g.setColor(textColor);
     if (icon.texture != null) {
       g.drawTexture(icon.texture, x + 4, y + (font.getHeight() - size) / 2, size, size);
       g.drawString(s, x + size + entryOffset + 4, y + font.getHeight() - 4);
     } else {
       g.drawString(s, x + entryOffset, y + font.getHeight() - 4);
     }
   } else {
     String s = value.toString();
     s = font.confineLength(s, width - 4);
     int entryOffset = 4 + alignment.alignX(width - 4, font.stringWidth(s));
     g.setFont(font);
     g.setColor(textColor);
     g.drawString(s, x + entryOffset, y + font.getHeight() - 4);
   }
 }