Java Code Examples for codechicken.nei.guihook.GuiContainerManager#enable2DRender()
The following examples show how to use
codechicken.nei.guihook.GuiContainerManager#enable2DRender() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiRecipe.java From NotEnoughItems with MIT License | 6 votes |
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GuiContainerManager.enable2DRender(); IRecipeHandler recipehandler = currenthandlers.get(recipetype); String s = recipehandler.getRecipeName(); fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0x404040); s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipehandler.recipiesPerPage() + 1); fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, ySize - 16, 0x404040); GlStateManager.pushMatrix(); GlStateManager.translate(5, 16, 0); for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) { recipehandler.drawForeground(i); GlStateManager.translate(0, 65, 0); } GlStateManager.popMatrix(); }
Example 2
Source File: GuiRecipe.java From NotEnoughItems with MIT License | 6 votes |
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GuiContainerManager.enable2DRender(); IRecipeHandler recipehandler = currenthandlers.get(recipetype); String s = recipehandler.getRecipeName(); fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0x404040); s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipehandler.recipiesPerPage() + 1); fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, ySize - 16, 0x404040); GlStateManager.pushMatrix(); GlStateManager.translate(5, 16, 0); for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) { recipehandler.drawForeground(i); GlStateManager.translate(0, 65, 0); } GlStateManager.popMatrix(); }