本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureManager.getDynamicTextureLocation方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureManager.getDynamicTextureLocation方法的具體用法?Java TextureManager.getDynamicTextureLocation怎麽用?Java TextureManager.getDynamicTextureLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.texture.TextureManager
的用法示例。
在下文中一共展示了TextureManager.getDynamicTextureLocation方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindTexturePackIcon
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
public void bindTexturePackIcon(TextureManager textureManagerIn)
{
if (this.locationTexturePackIcon == null)
{
this.locationTexturePackIcon = textureManagerIn.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon));
}
textureManagerIn.bindTexture(this.locationTexturePackIcon);
}
示例2: bindTexturePackIcon
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
public void bindTexturePackIcon(TextureManager textureManagerIn)
{
BufferedImage bufferedimage = null;
if (this.locationTexturePackIcon == null)
{
try
{
bufferedimage = this.reResourcePack.getPackImage();
}
catch (IOException var5)
{
;
}
if (bufferedimage == null)
{
try
{
bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(ResourcePackRepository.field_191400_f).getInputStream());
}
catch (IOException ioexception)
{
throw new Error("Couldn\'t bind resource pack icon", ioexception);
}
}
}
if (this.locationTexturePackIcon == null)
{
this.locationTexturePackIcon = textureManagerIn.getDynamicTextureLocation("texturepackicon", new DynamicTexture(bufferedimage));
}
textureManagerIn.bindTexture(this.locationTexturePackIcon);
}
示例3: bindTexturePackIcon
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
public void bindTexturePackIcon(TextureManager textureManagerIn)
{
BufferedImage bufferedimage = null;
try
{
bufferedimage = this.reResourcePack.getPackImage();
}
catch (IOException var5)
{
;
}
if (bufferedimage == null)
{
try
{
bufferedimage = ResourcePackRepository.this.rprDefaultResourcePack.getPackImage();
}
catch (IOException ioexception)
{
throw new Error("Couldn\'t bind resource pack icon", ioexception);
}
}
if (this.locationTexturePackIcon == null)
{
this.locationTexturePackIcon = textureManagerIn.getDynamicTextureLocation("texturepackicon", new DynamicTexture(bufferedimage));
}
textureManagerIn.bindTexture(this.locationTexturePackIcon);
}
示例4: drawSplashScreen
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
logger.error((String)("Unable to load logo: " + locationMojangPng), (Throwable)ioexception);
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0, 0, j, k, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例5: drawSplashScreen
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException {
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i,
scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(),
(double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try {
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo",
new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
} catch (IOException ioexception) {
logger.error((String) ("Unable to load logo: " + locationMojangPng), (Throwable) ioexception);
} finally {
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255)
.endVertex();
worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D)
.color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0,
0, j, k, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例6: drawSplashScreen
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例7: createFont
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
private void createFont(final Object font, final float size) {
try {
if (font instanceof Font) {
this.theFont = (Font)font;
}
else if (font instanceof File) {
this.theFont = Font.createFont(0, (File) font).deriveFont(size);
}
else if (font instanceof InputStream) {
this.theFont = Font.createFont(0, (InputStream)font).deriveFont(size);
((InputStream) font).close();
}
else if (font instanceof String) {
this.theFont = new Font((String)font, 0, Math.round(size));
}
else {
this.theFont = new Font("Verdana", 0, Math.round(size));
}
this.theGraphics.setFont(this.theFont);
}
catch (Exception e) {
e.printStackTrace();
this.theFont = new Font("Verdana", 0, Math.round(size));
this.theGraphics.setFont(this.theFont);
}
this.theGraphics.setColor(new Color(255, 255, 255, 0));
this.theGraphics.fillRect(0, 0, 256, 256);
this.theGraphics.setColor(Color.white);
this.theMetrics = this.theGraphics.getFontMetrics();
float x = 5.0f;
float y = 5.0f;
for (int i = this.startChar; i < this.endChar; ++i) {
this.theGraphics.drawString(Character.toString((char)i), x, y + this.theMetrics.getAscent());
this.xPos[i - this.startChar] = x;
this.yPos[i - this.startChar] = y - this.theMetrics.getMaxDescent();
x += this.theMetrics.stringWidth(Character.toString((char)i)) + 2.0f;
if (x >= 250 - this.theMetrics.getMaxAdvance()) {
x = 5.0f;
y += this.theMetrics.getMaxAscent() + this.theMetrics.getMaxDescent() + this.fontSize / 2.0f;
}
}
final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
final String string = "font" + font.toString() + size;
final DynamicTexture dynamicTexture = new DynamicTexture(this.bufferedImage);
this.dynamicTexture = dynamicTexture;
this.resourceLocation = textureManager.getDynamicTextureLocation(string, dynamicTexture);
}
示例8: drawSplashScreen
import net.minecraft.client.renderer.texture.TextureManager; //導入方法依賴的package包/類
public void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}