Beispiel #1
0
 private void drawString(GLEx g) {
   int activeNum = getActiveNum();
   arrayR[activeNum] = 20;
   g.setColor(224, 255, 255);
   for (int j = 0; j < number; j++) {
     arrayR[j] += 8;
     g.drawString(message, getShoutX(j) - mesWidth, getShoutY(j) - mesHeight);
   }
   g.resetColor();
 }
Beispiel #2
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);
   }
 }
 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);
 }