Example #1
0
 public void renderStaticSection(Context c) {
   int row = 0;
   float x = 0, y = 0;
   if (startLine < 0) {
     y = -startLine * charHeight;
     row = -startLine;
   } else {
     y = 0;
     row = 0;
   }
   for (int i = appendOnly.getLineStart(startLine); i < appendOnly.length() && row < rows; i++) {
     char character = appendOnly.getCharAt(i);
     if (character != '\n') {
       Sprite s = font.getSprite(character);
       if (s != null) {
         c.pushTransform();
         c.appendTransform(Matrix.translation(x, y, 0));
         s.render(c);
         c.popTransform();
       }
       x += charWidth;
     } else {
       y += charHeight;
       row++;
       x = 0;
     }
   }
 }
Example #2
0
 private void renderChar(Context c, char character, float x, float y) {
   Sprite s = font.getSprite(character);
   if (s != null) {
     c.pushTransform();
     c.appendTransform(Matrix.translation(x, y, 0));
     s.render(c);
     c.popTransform();
   }
 }
Example #3
0
  private void renderCursor(float x, float y, Context c) {
    if (blinkTime < blinkPeriod / 2) {
      GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
      GL14.glBlendFuncSeparate(
          GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_ZERO);
      GL20.glBlendEquationSeparate(GL14.GL_FUNC_ADD, GL14.GL_FUNC_ADD);

      c.resetColor();
      c.pushTransform();
      c.appendTransform(Matrix.translation(x, y, 0));
      font.getSprite(getCursorChar()).render(c);
      c.popTransform();

      GL11.glPopAttrib();
    }
  }