Jump to content

Recommended Posts

Posted

Hi!

I made a Gui screen for MC1.3.2, I think I write it good, but only the textfield dont want to work.

You need to travel to the past if you want to help me. :)

 

Here's the GuiScreen file:

@SideOnly(Side.CLIENT)
public class GuiLogin extends GuiScreen
{
private final GuiScreen parentScreen;
private GuiTextField username;

public void initGui()
{
	super.initGui();
	username = new GuiTextField(this.fontRenderer, this.width / 2, this.height / 2, 100, 20);
    	this.username.setTextColor(-1);
        this.username.setMaxStringLength(10);
        this.username.setEnableBackgroundDrawing(true);
        this.username.setVisible(true);
}

    public GuiLogin(GuiScreen par1GuiScreen)
    {
        this.parentScreen = par1GuiScreen;
    }
    
    @Override
    public void drawScreen(int x, int y, float f)
    {
    	this.initGui();
    	this.username.drawTextBox();
    	this.BackGround();
    	super.drawScreen(x, y, f);
    }
    
    private void BackGround()
    {
    	final int xSizeOfTexture = 176;
    	final int ySizeOfTexture = 88;
    	
    	drawDefaultBackground();
    	
    	int var4 = this.mc.renderEngine.getTexture("/mmod/media/default.png");
    	
    	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    	this.mc.renderEngine.bindTexture(var4);
    	
    	int posX = (this.width - xSizeOfTexture) / 2;
    	int posY = (this.height - ySizeOfTexture) / 2;
    	
    	drawTexturedModalRect(posX, posY, 0, 0, xSizeOfTexture, ySizeOfTexture);
    }
}

 

Please help me! :D

Posted

GuiScreen#initGui() should only be called when you open a GUI or when you change the resolution of your screen. This is already done for you, don't call it every render tick...

 

To maybe solve your problem: Try rendering the textbox after you've drawn your screen. It could be that the textbox is now rendered behind your screen.

this.BackGround();
this.username.drawTextBox();

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Posted

I dont like the "New Minecraft". I think the original minecraft sandbox feeling was lost after the patch 1.3.2. :)

 

EDIT:

MineMaarten, thanks, it works! (and im a retard 'couse i didnt see that xD)

Posted

I dont like the "New Minecraft". I think the original minecraft sandbox feeling was lost after the patch 1.3.2. :)

I understand that, but it didn't lost it in my opinion...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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