本文整理汇总了Java中net.minecraft.client.gui.inventory.GuiInventory.drawEntityOnScreen方法的典型用法代码示例。如果您正苦于以下问题:Java GuiInventory.drawEntityOnScreen方法的具体用法?Java GuiInventory.drawEntityOnScreen怎么用?Java GuiInventory.drawEntityOnScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.gui.inventory.GuiInventory
的用法示例。
在下文中一共展示了GuiInventory.drawEntityOnScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawCharacter
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
private void drawCharacter(int x, int y, int size, int cursorX, int cursorY) {
final float mouseX = (float) x - cursorX;
final float mouseY = (float) y - size * 1.67F - cursorY;
EntityLivingBase tmp = (EntityLivingBase)character.ridingEntity;
IS_VIEWING = true;
if (character.isRiding() && OptionCore.MOUNT_STAT_VIEW.getValue())
GuiInventory.drawEntityOnScreen(x, y, size, mouseX, mouseY, tmp);
else GuiInventory.drawEntityOnScreen(x, y, size, mouseX, mouseY, character);
IS_VIEWING = false;
GLCore.glRescaleNormal(true);
GLCore.glTexture2D(true);
GLCore.glBlend(true);
GLCore.tryBlendFuncSeparate(770, 771, 1, 0);
}
示例2: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if(player.getEntityData().hasKey("craftingTable"))
Core.bindTexture(UPPER_TEXTURE);
else
Core.bindTexture(UPPER_TEXTURE_2X2);
int k = this.guiLeft;
int l = this.guiTop;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, 102);
//Draw the player avatar
GuiInventory.drawEntityOnScreen(k + 51, l + 75, 30, k + 51 - this.xSizeLow, l + 75 - 50 - this.ySizeLow, this.mc.player);
PlayerInventory.drawInventory(this, width, height, ySize - PlayerInventory.invYSize);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(textures);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
// weight
drawIconBar(cat.getWeight(), EntityFatCat.WEIGHT_STATUS_MAX, 10, guiLeft + 70, guiTop + 22, xSize, 3*8, xSize+8, 3*8);
// health
drawIconBar(cat.getHealth(), cat.getMaxHealth(), 5, guiLeft + 70, guiTop + 46, xSize, 1*8, xSize+8, 1*8);
// hunger
drawIconBar(cat.getHunger(), EntityFatCat.HUNGER_MAX, 5, guiLeft + 130, guiTop + 46, xSize, 2*8, xSize+8, 2*8);
// bladder
drawIconBar(cat.getBladder(), EntityFatCat.BLADDER_MAX, 5, guiLeft + 70, guiTop + 68, xSize, 0*8, xSize+8, 0*8);
// tiredness
drawIconBar(cat.getTiredness(), EntityFatCat.TIREDNESS_MAX, 5, guiLeft + 130, guiTop + 68, xSize, 8*4, xSize+8, 8*4);
// friendship
drawIconBar(cat.getFriendship(), EntityFatCat.FRIENDSHIP_MAX, 5, guiLeft + 70, guiTop + 90, xSize, 8*5, xSize+8, 8*5);
// loveness
drawIconBar(cat.getLoveness(), EntityFatCat.FRIENDSHIP_MAX, 5, guiLeft + 130, guiTop + 90, xSize, 8*6, xSize+8, 8*6);
// !! change scale in the following method, so we should put this at last !!
GuiInventory.drawEntityOnScreen(guiLeft + 36, guiTop + 55, 30, guiLeft + 24 - mouseX, guiTop + 5 - mouseY, cat);
}
示例4: drawPages
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
public static void drawPages(FontRenderer renderer, int mouseX, int mouseY, int currentPage, CATEGORY currentCategory, GuiScreen gui)
{
if (currentCategory == null)
{
drawCategoryModels();
}
if (currentCategory == CATEGORY.DINOS)
{
if (currentPage == 0)
{
/* Page 1 / 2*/
GuiInventory.drawEntityOnScreen(getLeft() + 14, 90, 20, -350f, -5F, new EntityRaptor(Minecraft.getMinecraft().theWorld, 1));
drawTitle(renderer, DINO_NAME.UTAHRAPTOR);
drawDiet(renderer, getLeft() + 40, 135, DINO_NAME.UTAHRAPTOR, gui);
drawSpecies(renderer, getLeft() + 15, 150, DINO_NAME.UTAHRAPTOR);
}
else if (currentPage == 2)
{
}
}
}
示例5: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(resSatchelContainer);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
this.drawTexturedModalRect(k + 61, l + 17, 0, this.ySize, (18 * this.getContainer().columns), (18 * this.getContainer().rows));
GuiInventory.drawEntityOnScreen(k + 34, l + 66, 24, (float)(k + 34) - this.field_147033_y, (float)(l + 95 - 66) - this.field_147032_z, this.player);
}
示例6: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawDefaultBackground();
this.mc.getTextureManager().bindTexture(background);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
for(EnumInventorySlots slot : EnumInventorySlots.values())
if(!inventorySlots.getSlot(slot.getId()).getHasStack())
HarshenClientUtils.drawTexture(slot.getPoint().x + this.guiLeft, slot.getPoint().y + this.guiTop,
13.26f, 9.89f + (slot.getId()), 1f, 1f, 16, 16, 16, 16);
GuiInventory.drawEntityOnScreen(i + 30, j + 75, 30, (float)(i + 51) - this.oldMouseX, (float)(j + 75 - 50) - this.oldMouseY, this.mc.player);
}
示例7: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
/**
* Draws the background layer of this container (behind the items).
*/
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(HORSE_GUI_TEXTURES);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
GuiInventory.drawEntityOnScreen(i + 51 + 25, j + 60, 17, i + 51 - this.mousePosx, j + 75 - 50 - this.mousePosY, this.horseEntity);
}
示例8: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GL11.glColor3d(1.0D, 1.0D, 1.0D);
this.mc.renderEngine.bindTexture(ACCESSORIES);
this.drawTexturedModalRect(this.width / 2 - 88, this.height / 2 - 166 / 2, 0, 0, 176, 166);
GuiInventory.drawEntityOnScreen(this.guiLeft + 35, this.guiTop + 75, 30, (float)(this.guiLeft + 51) - (float)mouseX, (float)(this.guiTop + 75 - 50) - (float)mouseY, this.mc.thePlayer);
}
示例9: GuiTeambattleOverlay
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
public GuiTeambattleOverlay(RenderGameOverlayEvent event) {
mc = Minecraft.getMinecraft();
if (!mc.gameSettings.showDebugInfo) {
if (TConfigs.showHUD)
drawLeftHud();
if (TConfigs.showEntity) {
float rotX = (float) (45 * Math.sin(mc.thePlayer.rotationYaw / 90 * Math.PI));
GuiInventory.drawEntityOnScreen(event.resolution.getScaledWidth() - 25, event.resolution.getScaledHeight() - 10, 40, -rotX, -mc.thePlayer.rotationPitch, mc.thePlayer);
}
}
}
示例10: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
/**
* Draws the background layer of the inventory.
*
* @param partialTicks The tick state of the client
* @param mouseX The X position of the mouse
* @param mouseY The Y position of the mouse
*/
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.pushMatrix();
{
GlStateManager.color(1, 1, 1, 1);
this.mc.getTextureManager().bindTexture(TEXTURE_GUI_WOLF_INVENTORY);
int positionX = (this.width - this.xSize) / 2;
int positionY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(positionX, positionY, 0, 0, this.xSize, this.ySize);
if (this.wolfArmor.getHasArmor()) {
this.drawTexturedModalRect(positionX + 7, positionY + 17, this.xSize, 36, 18, 18);
}
if (this.wolfArmor.getHasChest()) {
this.drawTexturedModalRect(positionX + 97, positionY + 17, this.xSize, 0, 54, 36);
}
GuiInventory.drawEntityOnScreen(positionX + 51, positionY + 60, 30, (float) (positionX + 51) - this.screenPositionX,
(float) (positionY - 50) - this.screenPositionY, this.theWolf);
}
GlStateManager.popMatrix();
}
示例11: drawScreen
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
mc.getTextureManager().bindTexture(BACKGROUND_TEXTURES);
drawTexturedModalRect((width - 174) / 2, (height - 161) / 2, 0, 0, 174, 161);
int guiWidth = (width - 174) / 2 + 58, guiHeight = (height - 161) / 2 + 140;
GuiInventory.drawEntityOnScreen(guiWidth, guiHeight, 60, guiWidth - mouseX, guiHeight - mouseY, player);
list.drawScreen(mouseX, mouseY, partialTicks);
super.drawScreen(mouseX, mouseY, partialTicks);
}
示例12: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partTick, int mX, int mY)
{
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
GuiInventory.drawEntityOnScreen(k + 51, l + 60, 17, (float) (k + 51) - mX, (float) (l + 75 - 50) - mY, this.dodo);
}
示例13: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
this.drawDefaultBackground();//dim the background as normal
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(background);
int i = this.guiLeft;
int j = this.guiTop;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
//COPIED FROM GuiInventory
GuiInventory.drawEntityOnScreen(i + 51, j + 75, 30, (float) (i + 51) - this.oldMouseX, (float) (j + 75 - 50) - this.oldMouseY, this.mc.player);
}
示例14: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if (entity instanceof EntityDarkZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Dark"));
}
else if (entity instanceof EntityDestroZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Destro"));
}
else if (entity instanceof EntityForisZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Foris"));
}
else if (entity instanceof EntityIceZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Ice"));
}
else if (entity instanceof EntityRedZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Red"));
}
else if (entity instanceof EntityMetalZertum) {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins("Metal"));
}
else {
this.mc.getTextureManager().bindTexture(ResourceReference.getInventorySkins(""));
}
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
drawTexturedModalRect(l, i1, 0, 0, xSize, ySize);
for (int j1 = 0; j1 < 3; j1++) {
for (int k1 = 0; k1 < 5; k1++) {
drawTexturedModalRect(l + 78 + 18 * k1, i1 + 9 + 18 * j1 + 15, 197, 2, 18, 18);
}
}
GuiInventory.drawEntityOnScreen(l + 42, i1 + 51, 30, l + 51 - xSize_wolf, (i1 + 75) - 50 - ySize_wolf, this.entity);
}
示例15: drawGuiContainerBackgroundLayer
import net.minecraft.client.gui.inventory.GuiInventory; //导入方法依赖的package包/类
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(resource);
int var5 = this.getGuiLeft();
int var6 = this.getGuiTop();
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GuiInventory.drawEntityOnScreen(var5 + 31, var6 + 75, 30, (float) (var5 + 51) - this.xSize_lo, (float) (var6 + 75 - 50) - this.ySize_lo, mc.player);
}