예제 #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();
 }
예제 #2
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);
 }
예제 #3
0
파일: Blood.java 프로젝트: DONGChuan/LGame
 @Override
 public void createUI(GLEx g) {
   if (!visible) {
     return;
   }
   if (alpha > 0 && alpha < 1) {
     g.setAlpha(alpha);
   }
   g.setColor(color);
   for (int i = 0; i < drops.length; ++i) {
     g.fillOval((int) drops[i].x, (int) drops[i].y, 2, 2);
   }
   g.resetColor();
   if (alpha > 0 && alpha < 1) {
     g.setAlpha(1);
   }
 }
예제 #4
0
 @Override
 public void draw(GLEx g, int tx, int ty) {
   next();
   int x = t_x - tx;
   int y = t_y - ty;
   g.setColor(LColor.black);
   if (super.frame < 40) {
     for (int i = 0; i < sd.length; i++) {
       sd[i].drawPaint(g, x, (LSystem.screenRect.height - y));
     }
   } else {
     int r = ((super.frame - 40) * 220) / 40;
     g.setColor(r, 0, 0);
     sd[0].drawPaint(g, x, (LSystem.screenRect.height - y));
   }
   if (super.frame > 80) {
     setExist(false);
   }
 }
예제 #5
0
 @Override
 public void draw(GLEx g, int x, int y) {
   next();
   g.setColor(color);
   for (int j = 0; j < arrow.length; j++) {
     arrow[j].drawPaint(g, s_x - x, (LSystem.screenRect.height - (s_y - y)));
   }
   if (super.frame >= max) {
     setExist(false);
   }
 }
예제 #6
0
 /**
  * 游戏背景绘制
  *
  * @param g
  */
 protected void background(GLEx g) {
   switch (backgroundMode) {
     case BACK_STAR_MODE:
       if (starColor != null) {
         g.setColor(starColor);
       }
       g.glBegin(GL.GL_LINES);
       for (int j = 0; j < dot_size; this.count = (this.count + 1) % dot_size) {
         int index = this.dot[this.count] % 3;
         g.glVertex2f(dot[count] - index, getHeight() - j * 10);
         g.glVertex2f(dot[count] + index, getHeight() - j * 10);
         g.glVertex2f(dot[count], getHeight() - j * 10 - index);
         g.glVertex2f(dot[count], getHeight() - j * 10 + index);
         ++j;
       }
       g.glEnd();
       if (starColor != null) {
         g.resetColor();
       }
       break;
     case BACK_SCROLL_MODE:
       if (scroll != null) {
         scroll.createUI(g);
       }
       break;
     case BACK_OTHER_MODE:
       drawOtherBackground(g);
       break;
     case BACK_EMPTY_MODE:
     default:
       break;
   }
 }
예제 #7
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));
     }
   }
 }
예제 #8
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);
   }
 }
예제 #9
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();
 }
예제 #10
0
  public void render(GLEx g, float x, float y) {

    if (!visible) {
      return;
    }

    if ((sprite == null) && (defaultImageName != null)) {
      loadSystemParticleImage();
    }

    g.translate(x, y);

    if (blendingMode == BLEND_ADDITIVE) {
      GLEx.self.setBlendMode(GL.MODE_ALPHA_ONE);
    }
    if (usePoints()) {
      GLEx.gl10.glEnable(GL.GL_POINT_SMOOTH);
      g.glTex2DDisable();
    }

    for (int emitterIdx = 0; emitterIdx < emitters.size(); emitterIdx++) {

      ParticleEmitter emitter = emitters.get(emitterIdx);

      if (!emitter.isEnabled()) {
        continue;
      }

      if (emitter.useAdditive()) {
        g.setBlendMode(GL.MODE_ALPHA_ONE);
      }

      ParticlePool pool = particlesByEmitter.get(emitter);
      LTexture image = emitter.getImage();
      if (image == null) {
        image = this.sprite;
      }

      if (!emitter.isOriented() && !emitter.usePoints(this)) {
        image.glBegin();
      }

      for (int i = 0; i < pool.particles.length; i++) {
        if (pool.particles[i].inUse()) {
          pool.particles[i].render();
        }
      }

      if (!emitter.isOriented() && !emitter.usePoints(this)) {
        image.glEnd();
      }

      if (emitter.useAdditive()) {
        g.setBlendMode(GL.MODE_NORMAL);
      }
    }

    if (usePoints()) {
      GLEx.gl10.glDisable(GL.GL_POINT_SMOOTH);
    }
    if (blendingMode == BLEND_ADDITIVE) {
      g.setBlendMode(GL.MODE_NORMAL);
    }

    g.resetColor();
    g.translate(-x, -y);
  }
예제 #11
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();
   }
 }
예제 #12
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);
 }