Exemplo n.º 1
0
 public final void paint(LGraphics g) {
   if (!running || isClose()) {
     return;
   }
   if (sleep == 0) {
     if (scrCG == null) {
       return;
     }
     if (scrCG.getBackgroundCG() != null) {
       if (shakeNumber > 0) {
         g.drawImage(
             scrCG.getBackgroundCG(),
             shakeNumber / 2 - LSystem.random.nextInt(shakeNumber),
             shakeNumber / 2 - LSystem.random.nextInt(shakeNumber));
       } else {
         g.drawImage(scrCG.getBackgroundCG(), 0, 0);
       }
     }
     int moveCount = 0;
     for (int i = 0; i < scrCG.getCharas().size(); i++) {
       Chara chara = (Chara) scrCG.getCharas().get(i);
       float value = 1.0f;
       if (chara.next()) {
         value = chara.getNextAlpha();
         moveCount++;
       }
       g.setAlpha(value);
       chara.draw(g);
       g.setAlpha(1.0F);
     }
     drawScreen(g);
     if (desktop != null) {
       desktop.createUI(g);
     }
     if (sprites != null) {
       sprites.createUI(g);
     }
   } else {
     sleep--;
     if (color != null) {
       double alpha = (double) (sleepMax - sleep) / sleepMax;
       if (alpha < 1.0) {
         if (scrCG.getBackgroundCG() != null) {
           g.drawImage(scrCG.getBackgroundCG(), 0, 0);
         }
         g.setAlpha(alpha);
         g.setColor(color);
         g.fillRect(0, 0, getCurrentWidth(), getCurrentHeight());
         g.setAlpha(1.0f);
       }
     }
     if (sleep <= 0) {
       sleep = 0;
       color = null;
     }
   }
 }
Exemplo n.º 2
0
 /** 创建程序UI */
 public synchronized void createUI(final LGraphics g) {
   draw(g);
   if (sprites != null) {
     sprites.createUI(g);
   }
   if (desktop != null) {
     desktop.createUI(g);
   }
 }
Exemplo n.º 3
0
 /**
  * 创建UI图像
  *
  * @param g
  */
 public void createUI(final GLEx g) {
   createUI(g, 0, 0);
 }