本文整理匯總了Java中net.minecraft.client.renderer.texture.DynamicTexture.getTextureData方法的典型用法代碼示例。如果您正苦於以下問題:Java DynamicTexture.getTextureData方法的具體用法?Java DynamicTexture.getTextureData怎麽用?Java DynamicTexture.getTextureData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.texture.DynamicTexture
的用法示例。
在下文中一共展示了DynamicTexture.getTextureData方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initDynamicTexture
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex)
{
MultiTexID multitexid = tex.getMultiTexID();
int[] aint = tex.getTextureData();
int i = width * height;
Arrays.fill(aint, i, i * 2, -8421377);
Arrays.fill((int[])aint, i * 2, i * 3, (int)0);
TextureUtil.allocateTexture(multitexid.base, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.norm, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.spec, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
GlStateManager.bindTexture(multitexid.base);
}
示例2: drawOverlay
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {
int[] pixelsOverlay = overlay.getTextureData();
System.arraycopy(pixelsCurrent, 0, pixelsOverlay, 0, pixelsOverlay.length);
if(shift){
drawLine(x, last_x, y, last_y, pixelsOverlay, rgb);
}else{
if (x > -1 && x < ImageData.IMAGE_RES && y > -1 && y < ImageData.IMAGE_RES){
pixelsOverlay[x+ImageData.IMAGE_RES*y] = rgb;
}
}
overlay.updateDynamicTexture();
}
示例3: drawOverlay
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {
int[] pixelsOverlay = overlay.getTextureData();
System.arraycopy(pixelsCurrent, 0, pixelsOverlay, 0, pixelsOverlay.length);
if(Mouse.isButtonDown(0) && last_x > -1000 && last_y > -1000){
if(shift){
if(last_y > y)
y = last_y - Math.abs(last_x - x);
else
y = last_y + Math.abs(last_x - x);
}
drawShape(Math.min(last_x, x),
Math.min(last_y, y),
Math.max(last_x, x),
Math.max(last_y, y),
pixelsOverlay,
rgb);
}
}
示例4: dynamicToImage
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
private BufferedImage dynamicToImage(DynamicTexture texture) {
int[] data = texture.getTextureData();
if (data.length != 128*128) return null;
BufferedImage image = new BufferedImage(128, 128, 2);
image.setRGB(0, 0, image.getWidth(), image.getHeight(), data, 0, 128);
return image;
}
示例5: createDefaultTexture
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
public static ITextureObject createDefaultTexture()
{
DynamicTexture dynamictexture = new DynamicTexture(1, 1);
dynamictexture.getTextureData()[0] = -1;
dynamictexture.updateDynamicTexture();
return dynamictexture;
}
示例6: drawOverlay
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {
int[] pixelsOverlay = overlay.getTextureData();
System.arraycopy(pixelsCurrent, 0, pixelsOverlay, 0, pixelsOverlay.length);
if (x > -1 && x < ImageData.IMAGE_RES && y > -1 && y < ImageData.IMAGE_RES){
pixelsOverlay[x+ImageData.IMAGE_RES*y] = rgb;
}
overlay.updateDynamicTexture();
}
示例7: drawOverlay
import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
@Override
public void drawOverlay(int x, int y, int[] pixals, DynamicTexture overlay, int rgb, boolean shift) {
BufferedImage bi = new BufferedImage(ImageData.IMAGE_RES, ImageData.IMAGE_RES, BufferedImage.TYPE_4BYTE_ABGR);
bi.setRGB(0,0,ImageData.IMAGE_RES, ImageData.IMAGE_RES, pixals, 0, ImageData.IMAGE_RES);
Graphics2D g = (Graphics2D) bi.getGraphics();
g.setColor(new Color(rgb));
Font f = new Font( "Arial", Font.PLAIN, 10);
g.setFont(f);
g.drawString(text, click_x, click_y);
int length = (int) f.getStringBounds(text, 0, text.length(), g.getFontRenderContext()).getMaxX();
if((System.currentTimeMillis() / 500) % 2 == 0)
g.drawLine(length+click_x+1, click_y, length+click_x+1, click_y-8);
int[] pixelsOverlay = overlay.getTextureData();
for(int x0 = 0; x0 < ImageData.IMAGE_RES; x0++){
for(int y0 = 0; y0 < ImageData.IMAGE_RES; y0++){
pixelsOverlay[x0+ImageData.IMAGE_RES*y0] = bi.getRGB(x0, y0);
}
}
overlay.updateDynamicTexture();
}