Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello everyone, i am need to draw white string in textfield, and i set it text color to 0xFFFFFF, but color now looks grey. Picture below. Need solution.

http://i.imgur.com/XfNxbZG.png

 

SOLUTION: If you're using drawDefaultBackground() method in drawScreen() at your gui, you must put it before drawing anything else.

  • Author

With this method, it is rendered

	   public void drawTextBox(int mouseX, int mouseY) {
      drawRect(this.posX - 1, this.posY - 1, this.posX + this.width + 1, this.posY + this.height + 1, -6250336);
      drawRect(this.posX, this.posY, this.posX + this.width, this.posY + this.height, -16777216);
      int color = 0xFFFFFF;
      boolean flag = this.isFocused() && this.cursorCounter / 6 % 2 == 0;
      int startLine = this.getStartLineY();
      int maxLine = this.height / this.fontrenderer.FONT_HEIGHT + startLine;
      List lines = this.getLines();
      int charCount = 0;
      int lineCount = 0;
      int maxSize = this.width - (this.isScrolling()?14:4);

      int k2;
      for(k2 = 0; k2 < lines.size(); ++k2) {
         String wholeLine = (String)lines.get(k2);
         String line = "";
         char[] xx = wholeLine.toCharArray();
         int yy = xx.length;

         for(int i$ = 0; i$ < yy; ++i$) {
            char c = xx[i$];
            if(this.fontrenderer.getStringWidth(line + c) > maxSize && this.wrapLine) {
               if(lineCount >= startLine && lineCount < maxLine) {
                  this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color);
               }

               line = "";
               ++lineCount;
            }

            if(flag && charCount == this.cursorPosition && lineCount >= startLine && lineCount < maxLine && super.canEdit) {
               int xx1 = this.posX + this.fontrenderer.getStringWidth(line) + 3;
               int yy1 = this.posY + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT + 4;
               if(this.getText().length() == this.cursorPosition) {
                  this.fontrenderer.drawString("_", xx1, yy1, color);
               } else {
                  this.drawCursorVertical(xx1, yy1, xx1 + 1, yy1 + this.fontrenderer.FONT_HEIGHT);
               }
            }

            ++charCount;
            line = line + c;
         }

         if(lineCount >= startLine && lineCount < maxLine) {
            this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color);
            if(flag && charCount == this.cursorPosition && super.canEdit) {
               int var20 = this.posX + this.fontrenderer.getStringWidth(line) + 3;
               yy = this.posY + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT + 4;
               if(this.getText().length() == this.cursorPosition) {
                  this.fontrenderer.drawString("_", var20, yy, color);
               } else {
                  this.drawCursorVertical(var20, yy, var20 + 1, yy + this.fontrenderer.FONT_HEIGHT);
               }
            }
         }

         ++lineCount;
         ++charCount;
      }

      k2 = Mouse.getDWheel();
      if(k2 != 0 && this.isFocused()) {
         this.addScrollY(k2 < 0?-10:10);
      }

      if(Mouse.isButtonDown(0)) {
         if(this.clickVerticalBar) {
            if(this.startClick >= 0) {
               this.addScrollY(this.startClick - (mouseY - this.posY));
            }

            if(this.hoverVerticalScrollBar(mouseX, mouseY)) {
               this.startClick = mouseY - this.posY;
            }

            this.startClick = mouseY - this.posY;
         }
      } else {
         this.clickVerticalBar = false;
      }

      this.listHeight = lineCount * this.fontrenderer.FONT_HEIGHT;
      this.drawVerticalScrollBar();
   }

  • Author

I mean, after i wrote

	        	 GL11.glPushMatrix();
        	 GL11.glColor3f(1, 1, 1);
            this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color);
            GL11.glPopMatrix();

nothing has been changed, color in vanilla version the same.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.