本文整理汇总了Java中codechicken.lib.render.CCRenderState.changeTexture方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.changeTexture方法的具体用法?Java CCRenderState.changeTexture怎么用?Java CCRenderState.changeTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codechicken.lib.render.CCRenderState
的用法示例。
在下文中一共展示了CCRenderState.changeTexture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
GL11.glColor4f(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
GL11.glPushMatrix();
GL11.glTranslatef(j + 5, k + 16, 0);
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
recipehandler.drawBackground(i);
GL11.glTranslatef(0, 65, 0);
}
GL11.glPopMatrix();
}
示例2: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
GlStateManager.color(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
GlStateManager.pushMatrix();
GlStateManager.translate(j + 5, k + 16, 0);
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
recipehandler.drawBackground(i);
GlStateManager.translate(0, 65, 0);
}
GlStateManager.popMatrix();
}
示例3: drawForeground
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawForeground(int recipe) {
GL11.glColor4f(1, 1, 1, 1);
GL11.glDisable(GL11.GL_LIGHTING);
if (this.getGuiTexture() != null && !this.getGuiTexture().isEmpty() && this.progressBar != null) {
CCRenderState.changeTexture(getGuiTexture());
drawProgressBar(progressBar.posX, progressBar.posY, progressBar.textureX, progressBar.textureY, progressBar.width, progressBar.height, progressBar.ticks, progressBar.direction);
}
drawExtras(recipe);
}
示例4: drawBackground
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawBackground(int recipe) {
GL11.glColor4f(1, 1, 1, 1);
if (!this.guiBackgroundTextureLocation.equals("nei:textures/gui/recipebg.png") && recipe % recipiesPerPage() == 0) {
CCRenderState.changeTexture(this.guiBackgroundTextureLocation);
GuiDraw.drawTexturedModalRect(-5, -16, 0, 0, 176, 166);
}
if (this.getGuiTexture() != null && !this.getGuiTexture().isEmpty()) {
CCRenderState.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, this.guiOffset.offsetX, this.guiOffset.offsetY, 166, 65);
}
}
示例5: draw
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void draw(int x, int y, int w, int h) {
CCRenderState.changeTexture(tex);
CCRenderState.reset();
CCRenderState.startDrawing();
int[] sw = new int[]{x, x+seg_w[0], x+w-seg_w[2], x+w};
int[] sh = new int[]{y, y+seg_h[0], y+h-seg_h[2], y+h};
for(int seg = 0; seg < 9; seg++)
drawSeg(sw, sh, seg);
CCRenderState.draw();
}
示例6: drawSlot
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
GL11.glColor4f(1, 1, 1, 1);
Potion potion = validPotions.get(slot);
PotionEffect effect = getEffect(potion.id);
boolean blank = effect == null;
if (effect == null)
effect = new PotionEffect(potion.id, 1200, 0);
int shade = selectedslot == slot ? 2 : blank ? 1 : 0;
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
drawTexturedModalRect(x, y, 0, 166 + getSlotHeight(slot) * shade, width - 30, getSlotHeight(slot));
drawTexturedModalRect(x + width - 30, y, width - 23, 166 + getSlotHeight(slot) * shade, 30, getSlotHeight(slot));
if (potion.hasStatusIcon()) {
CCRenderState.changeTexture("textures/gui/container/inventory.png");
int icon = potion.getStatusIconIndex();
drawTexturedModalRect(x + 1, y + 1, icon % 8 * 18, 198 + icon / 8 * 18, 18, 18);
}
String name = StatCollector.translateToLocal(potion.getName());
String amp = effect.getAmplifier() > 0 ? " " + translateAmplifier(effect.getAmplifier()) : "";
int textColour = shade == 0 ? 0x685e4a : shade == 1 ? 0x407f10 : 0xffff80;
if (fontRenderer.getStringWidth(name + amp) < width - 20) {
fontRenderer.drawString(name + amp, x + 20, y + 1, textColour);
} else {
fontRenderer.drawString(name, x + 20, y + 1, textColour);
FontUtils.drawRightString(amp, x + width - 10, y + 10, textColour);
}
String duration = Potion.getDurationString(effect);
textColour = shade == 0 ? 0xA0A0A0 : shade == 1 ? 0x808080 : 0xCCCCCC;
fontRenderer.drawStringWithShadow(duration, x + 20, y + 10, textColour);
}
示例7: drawBackground
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawBackground() {
CCRenderState.changeTexture("nei:textures/gui/potion.png");
drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);
FontUtils.drawCenteredString("Favourite Potions", xSize / 2, 4, 0x404040);
fontRendererObj.drawString("Duration", 12, 40, 0x404040);
fontRendererObj.drawString("Level", 19, 73, 0x404040);
FontUtils.drawCenteredString(translateAmplifier(amplifier), 33, 86, 0xFF606060);
}
示例8: drawSlots
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void drawSlots(GuiEnchantmentModifier gui) {
for (int slot = 0; slot < 3; slot++) {
int shade = 0;
String text = "";
int containerslot = slot + getScrolledSlots();
if (containerslot + 1 > slotEnchantment.size()) {
shade = 1;
} else {
EnchantmentHash e = slotEnchantment.get(containerslot);
shade = e.state;
text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level);
if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Projectile")) {
text = text.replace("Projectile", "Proj");
}
if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Protection")) {
text = text.replace("Protection", "Protect");
}
if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Bane of")) {
text = text.replace("Bane of ", "");
}
}
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
GL11.glColor3f(1, 1, 1);
if (hasScrollBar()) {
gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight);
gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight);
} else {
gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight);
}
gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade));
}
}
示例9: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
GL11.glColor4f(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/inv.png");
int x = guiLeft;
int y = guiTop - 4;
drawTexturedModalRect(x - 23, y, 0, 0, 199, 204);
}
示例10: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
GL11.glColor4f(1, 1, 1, 1);
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
GL11.glTranslatef(guiLeft, guiTop, 0);
drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);
container.onUpdate(i, j);
container.drawSlots(this);
container.drawScrollBar(this);
String levelstring = "" + container.level;
fontRendererObj.drawString(levelstring, 33 - fontRendererObj.getStringWidth(levelstring) / 2, 34, 0xFF606060);
GL11.glTranslatef(-guiLeft, -guiTop, 0);
}
示例11: drawSlot
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
GlStateManager.color(1, 1, 1, 1);
Potion potion = validPotions.get(slot);
PotionEffect effect = getEffect(potion.id);
boolean blank = effect == null;
if (effect == null)
effect = new PotionEffect(potion.id, 1200, 0);
int shade = selectedslot == slot ? 2 : blank ? 1 : 0;
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
drawTexturedModalRect(x, y, 0, 166 + getSlotHeight(slot) * shade, width - 30, getSlotHeight(slot));
drawTexturedModalRect(x + width - 30, y, width - 23, 166 + getSlotHeight(slot) * shade, 30, getSlotHeight(slot));
if (potion.hasStatusIcon()) {
CCRenderState.changeTexture("textures/gui/container/inventory.png");
int icon = potion.getStatusIconIndex();
drawTexturedModalRect(x + 1, y + 1, icon % 8 * 18, 198 + icon / 8 * 18, 18, 18);
}
String name = StatCollector.translateToLocal(potion.getName());
String amp = effect.getAmplifier() > 0 ? " " + translateAmplifier(effect.getAmplifier()) : "";
int textColour = shade == 0 ? 0x685e4a : shade == 1 ? 0x407f10 : 0xffff80;
if (fontRenderer.getStringWidth(name + amp) < width - 20) {
fontRenderer.drawString(name + amp, x + 20, y + 1, textColour);
} else {
fontRenderer.drawString(name, x + 20, y + 1, textColour);
FontUtils.drawRightString(amp, x + width - 10, y + 10, textColour);
}
String duration = Potion.getDurationString(effect);
textColour = shade == 0 ? 0xA0A0A0 : shade == 1 ? 0x808080 : 0xCCCCCC;
fontRenderer.drawStringWithShadow(duration, x + 20, y + 10, textColour);
}
示例12: drawSlots
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void drawSlots(GuiEnchantmentModifier gui) {
for (int slot = 0; slot < 3; slot++) {
int shade = 0;
String text = "";
int containerslot = slot + getScrolledSlots();
if (containerslot + 1 > slotEnchantment.size()) {
shade = 1;
} else {
EnchantmentHash e = slotEnchantment.get(containerslot);
shade = e.state;
text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level);
if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Projectile")) {
text = text.replace("Projectile", "Proj");
}
if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Protection")) {
text = text.replace("Protection", "Protect");
}
if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Bane of")) {
text = text.replace("Bane of ", "");
}
}
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
GlStateManager.color(1, 1, 1);
if (hasScrollBar()) {
gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight);
gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight);
} else {
gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight);
}
gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade));
}
}
示例13: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
GlStateManager.color(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/inv.png");
int x = guiLeft;
int y = guiTop - 4;
drawTexturedModalRect(x - 23, y, 0, 0, 199, 204);
}
示例14: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
GlStateManager.color(1, 1, 1, 1);
CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
GlStateManager.translate(guiLeft, guiTop, 0);
drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);
container.onUpdate(i, j);
container.drawSlots(this);
container.drawScrollBar(this);
String levelstring = "" + container.level;
fontRendererObj.drawString(levelstring, 33 - fontRendererObj.getStringWidth(levelstring) / 2, 34, 0xFF606060);
GlStateManager.translate(-guiLeft, -guiTop, 0);
}
示例15: drawButtonTex
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawButtonTex(int mousex, int mousey) {
super.drawButtonTex(mousex, mousey);
GlStateManager.color(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/patreonNeon.png");
int texh = height-4;
int texw = texh*4;
drawModalRectWithCustomSizedTexture(x+width/2-texw/2, y+height/2-texh/2, 0, 0, texw, texh, texw, texh);
}