Jump to content

[Solved][1.6.2]Gui texture oversized.


Naiten

Recommended Posts

So, i try to open a gui, here's what i get:

bEePZZK.png

My gui texture:

EsuatPl.png

My draw gui class:

public class GuiTub extends GuiContainer{

public GuiTub(InventoryPlayer invPlayer, CherTub tub) {
	super(new ContainerTub(invPlayer, tub));
	xSize = 176;
	ySize = 149;
}

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        Minecraft.getMinecraft().func_110434_K().func_110577_a(
        		new ResourceLocation("row:textures/gui/gui_tub.png"));
        int posx = (width - xSize) / 2;
        int posy = (height - ySize) / 2;
        drawTexturedModalRect(posx, posy, 0, 0, xSize, ySize);
}

}

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Link to comment
Share on other sites

You are assigning new values to xSize and ySize, remove these new assignments and keep everything else. The reason is because you are assigning a new value to xSize and ySize, which GuiContainer uses these values to find the size of the inventory window in pixels. I recommend removing these assignments, then tell me how it went.

 

Change this

public GuiTub(InventoryPlayer invPlayer, CherTub tub) {
	super(new ContainerTub(invPlayer, tub));
	xSize = 176;
	ySize = 149;
}

 

to this

public GuiTub(InventoryPlayer invPlayer, CherTub tub) {
	super(new ContainerTub(invPlayer, tub));
}

 

and remove the new assignments

 

Also where you say,

Minecraft.getMinecraft().func_110434_K().func_110577_a(
        		new ResourceLocation("row:textures/gui/gui_tub.png"));

 

you don't need to create another instance, GuiContainer already has an instance of Minecraft, it looks like this

this.mc.func_110434_K().func_110577_a(yourtexturefile)

But you don't need to do the above if you don't want to, it will just decrease the amount of objects (and code that you have to write) and be much easier, totally up to you to change the above code.

 

If the above methods do not work, I recommend you still remove the new assignments of xSize and ySize, and use the furnace gui texture as your template, just paste over it and remove the furnace bar icons, keep all of the empty space. This worked for me with my gui.

 

Hope I have been of help to you

Link to comment
Share on other sites

Those assigned values are exact size of my texture. And i made my texture from chest one, there's no problem with it's size.

Anyway, if i remove those assignments, it works neither.

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Link to comment
Share on other sites

public static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel){
	Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1);
        tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1);
        tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0);
        tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0);
        tessellator.draw();
}

sry for formatting,

 

 

this will fit the image entirelly inside the quad no matter what its size is (so you dont have to worry about stupid power of 2 wtv ass thing notch did)

just bind the texture and call this function

 

 

Minecraft.getMinecraft().renderEngine.func_somenumber_a(ResourceLocation);//bind texture
drawTexturedQuadFit(x, y, width, height, zLevel);//render nice image

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

 

... Nice utility code here ...

... Prevents frustration and gives more freedom with GUI textures ...

Minecraft.getMinecraft().renderEngine.func_somenumber_a(ResourceLocation);//bind texture
drawTexturedQuadFit(x, y, width, height, zLevel);//render nice image

 

Thank you!

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • KLIK DISINI >>> LINK LOGIN & DAFTAR KLIK DISINI >>>   DAFTAR AKUN GACOR KLIK DISINI >>> DAFTAR AKUN VVIP KLIK DISINI >>> DAFTAR AKUN SLOT ANTI RUNGKAD KLIK DISINI >>>  LINK ALTERNATIF KLIK DISINI >>> AKUN GACOR SCATTER HITAM ULTRA88 adalah slot gacor winrate 100% dengan server thailand dan akun pro. Dapatkan akses menuju kemenangan ke puluhan sampai ratusan juta rupiah hanya dalam hitungan menit. 3 web yang kami hadirkan ini adalah yang terbaik dengan histori kemenangan tertinggi di satu Asia Tenggara. Member-member dari web ini selalu kembali karena tim admin dan CS yang profesional serta kemenangan berapapun pasti akan dibayar. RTP slot gacor juga sudah disiapkan agar kalian tidak bingung lagi mau main apa dan di jam berapa. Semua fasilitas seperti deposit dana dan pulsa sudah disiapkan juga untuk kemudahan para slotters. Jadi tunggu apalagi? Raih kemenangan kalian disini sekarang juga!
    • >> DAFTAR KLIK DISINI << >> DAFTAR KLIK DISINI << PROMO SLOT GRATIS kami sangat cocok bagi mereka yang ingin mencoba keberuntungan tanpa mengeluarkan banyak uang. Dengan pilihan IP tanpa batas, slot ini menjamin gameplay yang adil dan tidak memihak. Jangan lewatkan kesempatan untuk menang besar tanpa mengeluarkan uang sepeser pun! Dapatkan slot promo gratis tanpa perlu deposit! Nikmati taruhan gratis dan akses tak terbatas ke IP pilihan Anda. Manfaatkan kesempatan ini untuk mencoba peruntungan dan menang besar. Jangan lewatkan penawaran eksklusif ini. Hanya tersedia untuk waktu terbatas.
    • KLIK DISINI >>> LINK LOGIN & DAFTAR KLIK DISINI >>>   DAFTAR AKUN GACOR KLIK DISINI >>> DAFTAR AKUN VVIP KLIK DISINI >>> DAFTAR AKUN SLOT ANTI RUNGKAD KLIK DISINI >>>  LINK ALTERNATIF KLIK DISINI >>> AKUN GACOR SCATTER HITAM SLOT888 adalah slot gacor winrate 100% dengan server thailand dan akun pro. Dapatkan akses menuju kemenangan ke puluhan sampai ratusan juta rupiah hanya dalam hitungan menit. 3 web yang kami hadirkan ini adalah yang terbaik dengan histori kemenangan tertinggi di satu Asia Tenggara. Member-member dari web ini selalu kembali karena tim admin dan CS yang profesional serta kemenangan berapapun pasti akan dibayar. RTP slot gacor juga sudah disiapkan agar kalian tidak bingung lagi mau main apa dan di jam berapa. Semua fasilitas seperti deposit dana dan pulsa sudah disiapkan juga untuk kemudahan para slotters. Jadi tunggu apalagi? Raih kemenangan kalian disini sekarang juga!
    • Winning303 menyediakan berbagai jenis permainan dengan kemenangan yang tinggi , slot gacor dengan winrate 100% , hanya dengan modal receh sudah bisa meraih jutaan  Nikmati berbagai permainan judi online yang menarik dengan jaminan keamanan dan kenyamanan di WINNING303 LINK ALTERNATIF => https://w303.pink/ref1x    
    • RELATED: Horror Games Inspired By Movies Still, there are some options for a Wizard if it comes to melee combat, and there also are some alternatives on the subject of the catalyst they use to solid Spells. For each, those alternatives are first-class: Spellbook: All three spellcasting options, the Staff, Spellbook, and Crystal Ball can all have a whole lot of extra advantages of Dark And Darker Gold on them depending on rarity. But, at a base degree, the Spellbook is the catalyst option gamers appeared to gravitate to. This spell-casting catalyst will increase a Wizard's movement velocity by using the maximum overall, which clearly makes a large distinction. Crystal Ball: The distinction among the three Spell catalysts is quite easy. The Staff is the default option and has melee assaults of its own, the Spellbook is faster all around however offers no melee alternatives, and the Crystal Ball is the center ground between the 2 in regard to motion velocity, however gamers may also equip a Dagger or something in their other hand at the identical time. Crossbow: That's right, Wizards can really run Crossbows, but it is without a doubt simplest well worth the usage of once or at maximum twice at some stage in a suit, and best as soon as a Wizard is out of Spell casts. Still, tricking an enemy into thinking a Wizard is out of Spells, simplest to tug out a Crossbow and launch a bolt into them is a surprisingly effective strategy. Rondel Dagger: Again, if it ever does come right down to melee combat, a Wizard loses ninety percent of the time. But, having a Rondel Dagger as a secondary or geared up alongside the Crystal Ball improves the ones odds at least a bit bit. The Wizard's Expansive Repertoire Of Spells. Moving on to the category all and sundry became in all likelihood anticipating when studying approximately the Wizard magnificence, the Spells. Which Spells are the quality to use on the Wizard and why? Or, not less than, which of them are the maximum 'meta'? Are those professional kind Wizards, together with ones that use White, Green, Red, or even Blue magic, or are they a piece extra stereotypical? Well, after doing a little research, those appear to be the consequences, listed from least to most used: Slow: Slows an opponent for a duration, maximum of the time is changed by means of Haste, but a few gamers choose to slow others in preference to velocity themselves up. Haste: Speeds the Wizard up by way of a quite noticeable amount for a brief duration. This is the important thing device Wizards use to usually maintain their combatants at variety, and the use of this they can outrun just about everybody in the game (outside of projectile guns or different Spells). Invisibility: One of the fine Spells to apply on Wizard, but only veteran players appear to be utilizing it to the maximum. Basically permits the Wizard to use the identical strategies as a Rogue does with their Hide capability. Fireball: The Spell everyone makes use of before everything, tends to reveal up in each game, and is nearly usually extraordinarily suitable. But, in Dark and Darker, gamers will fast realizes that it is straightforward to hit allies with and there are better options for normal damage. Chain Lightning: Likely the pleasant alternative damage-sensible, and the friendly-fireplace element of it's far a chunk misleading (would not clearly chain to allies find it irresistible says it does). When aimed well, can decimate an unaware foe. Magic Missile: The most iconic 'Wizard Spell', Magic Missile, is tremendously right in Dark and Darker as properly. It's extraordinary for NPC enemies, excellent for region denial in a PvP fight, and it is the pleasant Spell to apply if the enemy manages to shut the space as it may speedy soften via their HP earlier than their swing connects. Last-Second General Wizard Tips. And it is pretty a great deal the whole thing gamers want to realize about constructing Wizards in Dark and Darker. This class, out of all of the instructions the sport currently gives Darker Gold, might be one of the maximum challenging ones to play for a newcomer.
  • Topics

×
×
  • Create New...

Important Information

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