コード例 #1
0
ファイル: Entity2D.java プロジェクト: nedhyett/Scarlet
 /** Draws the entity on the screen. */
 public void draw() {
   if (texture == null) {
     return;
   }
   GL11.glPushMatrix();
   if (hitbox != null && drawHitboxes) {
     Util2D.drawRect(hitbox.startX, hitbox.xLength, hitbox.startY, hitbox.yLength);
   }
   Util2D.drawTexturedQuad(texture, (int) x, (int) y);
   GL11.glPopMatrix();
 }
コード例 #2
0
 @Override
 public void customRender(int delta) {
   // this.isillegalyouknow();
   GL11.glPushMatrix();
   Util2D.drawTexturedQuad(
       background,
       startX + offset - 10 - ((travelDirection) ? text.length() * 10 : 0),
       startY - 10,
       text.length() * 32 + 40,
       20);
   Util2D.renderText(
       text, startX + offset - ((travelDirection) ? text.length() * 10 : 0), startY + 10);
   GL11.glPopMatrix();
   boolean done = computeOffset();
   if (done) {
     if (timeout <= 0) {
       close();
     } else {
       timeout -= 1;
     }
   }
 }