예제 #1
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();
 }
예제 #2
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();
   }
 }
예제 #3
0
 @Override
 public void createUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) {
   LFont font = g.getFont();
   int color = g.getColorARGB();
   if (batch != null) {
     batch.begin();
     draw(batch, mainX + x, mainY + y);
     batch.end();
   }
   g.setColor(color);
   g.setFont(font);
 }
예제 #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);
   }
 }
예제 #5
0
 public final synchronized void draw(GLEx g) {
   background(g);
   if (isOnLoadComplete()) {
     if (spriteLength == 0) {
       return;
     }
     bitmapPack.glBegin();
     for (int j = 0; j < spriteLength; ++j) {
       if (spriteList == null) {
         continue;
       }
       final int id = spriteList[j];
       STGPlane plane = planes.get(id);
       if (plane == null) {
         continue;
       }
       if (onDrawPlane(g, id)) {
         continue;
       }
       if (plane.view) {
         if (plane.planeMode == GRP_MODE) {
           if (plane.animation) {
             if (plane.delay.action(elapsedTime)) {
               int index;
               for (index = 0; plane.animeList[index] != plane.animeNo; ++index) {;
               }
               index = (index + 1) % plane.animeList.length;
               plane.animeNo = plane.animeList[index];
             }
           }
           if (plane.scaleX == 1 && plane.scaleY == 1) {
             bitmapPack.draw(
                 plane.images.get(plane.animeNo),
                 plane.posX,
                 plane.posY,
                 plane.rotation,
                 plane.drawColor);
           } else {
             bitmapPack.draw(
                 plane.images.get(plane.animeNo),
                 plane.posX,
                 plane.posY,
                 plane.rect.width * plane.scaleX,
                 plane.rect.height * plane.scaleY,
                 plane.rotation,
                 plane.drawColor);
           }
         } else if (plane.planeMode == STR_MODE) {
           g.setFont(plane.font);
           g.setColor(plane.color);
           g.drawString(plane.str, plane.posX, plane.posY + plane.font.getSize());
         } else if (plane.planeMode == CENTER_STR_MODE) {
           g.setFont(plane.font);
           g.setColor(plane.color);
           g.drawString(
               plane.str,
               plane.posX - plane.font.stringWidth(plane.str) / 2,
               plane.posY + plane.font.getSize());
         } else if (plane.planeMode == DRW_MODE) {
           plane.draw.paint(g, plane);
         }
       }
     }
     bitmapPack.glEnd();
   }
   foreground(g);
 }