當前位置: 首頁>>代碼示例>>Java>>正文


Java DynamicTexture.updateDynamicTexture方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.texture.DynamicTexture.updateDynamicTexture方法的典型用法代碼示例。如果您正苦於以下問題:Java DynamicTexture.updateDynamicTexture方法的具體用法?Java DynamicTexture.updateDynamicTexture怎麽用?Java DynamicTexture.updateDynamicTexture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.texture.DynamicTexture的用法示例。


在下文中一共展示了DynamicTexture.updateDynamicTexture方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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();
}
 
開發者ID:Mine-and-blade-admin,項目名稱:Battlegear2,代碼行數:17,代碼來源:PenTool.java

示例2: 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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:8,代碼來源:ShadersTex.java

示例3: loadImage

import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
public static void loadImage(BufferedImage bufferedImage, String imageID) {
    ResourceLocation newLoc = new ResourceLocation(imageID);
    location = newLoc;
    texture = new DynamicTexture(bufferedImage.getWidth(), bufferedImage.getHeight());
    Minecraft.getMinecraft().getTextureManager().loadTexture(location, texture);
    bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), texture.getTextureData(), 0, bufferedImage.getWidth());
    texture.updateDynamicTexture();
    currenLoadedImageID = imageID;
    image = bufferedImage;
    hasImage = true;

}
 
開發者ID:modmuss50,項目名稱:TechnicalDimensions,代碼行數:13,代碼來源:GuiLinkingDevice.java

示例4: FrameBuffer

import net.minecraft.client.renderer.texture.DynamicTexture; //導入方法依賴的package包/類
public FrameBuffer(TextureManager i_textureManager) {
  textureManager = i_textureManager;
  int textureHeightTexels = BLOCK_COUNT_DESIRED * V_TEXELS_PER_FACE;
  int maximumTextureHeight = Minecraft.getGLMaximumTextureSize();
  if (textureHeightTexels <= maximumTextureHeight) {
    BLOCK_COUNT = BLOCK_COUNT_DESIRED;
  } else {
    BLOCK_COUNT = maximumTextureHeight / V_TEXELS_PER_FACE;
    textureHeightTexels = maximumTextureHeight;
  }
  LAST_BLOCK_INDEX_PLUS_ONE = FIRST_BLOCK_INDEX + BLOCK_COUNT - 1;

  int textureWidthTexels = NUMBER_OF_FACES_PER_BLOCK * U_TEXELS_PER_FACE;

  TEXEL_HEIGHT_PER_BLOCK = 1.0 / BLOCK_COUNT;
  TEXEL_WIDTH_PER_FACE = 1.0 / NUMBER_OF_FACES_PER_BLOCK;

  nextFreeTextureIndex = FIRST_BLOCK_INDEX;
  firstUncachedIndex = FIRST_BLOCK_INDEX;
  blockTextures = new DynamicTexture(textureWidthTexels, textureHeightTexels);
  textureAllocated = true;
  textureResourceLocation = textureManager.getDynamicTextureLocation("SelectionBlockTextures", blockTextures);

  eraseBlockTextures(NULL_BLOCK_INDEX, NULL_BLOCK_INDEX);
  eraseBlockTextures(FIRST_BLOCK_INDEX, LAST_BLOCK_INDEX_PLUS_ONE - 1);
  blockTextures.updateDynamicTexture();

  ++sbtCount;
  if (sbtCount > SBT_COUNT_WARNING) {
    System.err.println("Warning: allocated " + sbtCount + " textures without release()");
  }
}
 
開發者ID:ItsAMysterious,項目名稱:Real-Life-Mod-1.8,代碼行數:33,代碼來源:FrameBuffer.java

示例5: 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();
}
 
開發者ID:Mine-and-blade-admin,項目名稱:Battlegear2,代碼行數:13,代碼來源:FloodFillTool.java

示例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) {
    overlay.updateDynamicTexture();
}
 
開發者ID:Mine-and-blade-admin,項目名稱:Battlegear2,代碼行數:5,代碼來源:EyeDropperTool.java

示例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();

}
 
開發者ID:Mine-and-blade-admin,項目名稱:Battlegear2,代碼行數:31,代碼來源:TextTool.java


注:本文中的net.minecraft.client.renderer.texture.DynamicTexture.updateDynamicTexture方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。