本文整理汇总了Java中net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java ElementType.ALL属性的具体用法?Java ElementType.ALL怎么用?Java ElementType.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType
的用法示例。
在下文中一共展示了ElementType.ALL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onHudRender
@SubscribeEvent
public static void onHudRender(RenderGameOverlayEvent.Pre event)
{
if (event.getType() == ElementType.ALL)
{
PlayerHUDRenderer.render(event.getPartialTicks());
}
if ( event.getType() == ElementType.HOTBAR ||
event.getType() == ElementType.FOOD ||
event.getType() == ElementType.HEALTH ||
event.getType() == ElementType.EXPERIENCE)
{
event.setCanceled(true);
}
}
示例2: onRenderGameOverlay
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Pre event) {
if (event.type != ElementType.ALL)
return;
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution var5 = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth,
Minecraft.getMinecraft().displayHeight);
int var6 = var5.getScaledWidth();
int var7 = var5.getScaledHeight();
mc.entityRenderer.setupOverlayRendering();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(0.5F, 0.5F, 0.5F, 1.0F);
bindOverlayTexture();
zLevel = -90f;
this.drawTexturedModalRect(0, var7 / 6, 0, 0, 147, 182);
fontRenderer.setUnicodeFlag(true);
int i = 0;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: afterDraw
@SubscribeEvent
public void afterDraw (RenderGameOverlayEvent.Post event) {
if (event.getType() != ElementType.ALL) return;
if (ZTS.displayStatus() == 1) {
computeDrawPosIfChanged();
drawRect(rectX1, rectSnY1, rectX2, rectSnY2, ZTS.toggleSneak?colorPack(0,0,196,196):colorPack(196,196,196,64));
drawString(mc.fontRendererObj, sneakTxt, rectX1 + 2, rectSnY1 + 2,
MIM.sneak?colorPack(255,255,0,96):colorPack(64,64,64,128));
drawRect(rectX1, rectSpY1, rectX2, rectSpY2, ZTS.toggleSprint?colorPack(0,0,196,196):colorPack(196,196,196,64));
drawString(mc.fontRendererObj, sprintTxt, rectX1 + 2, rectSpY1 + 2,
MIM.sprint?colorPack(255,255,0,96):colorPack(64,64,64,128));
} else if (ZTS.displayStatus() == 2) {
// no optimization here - I don't like the text only display anyway
computeTextPos(onlyTxt = MIM.displayText());
drawString(mc.fontRendererObj, onlyTxt, rectX1, rectSnY1, colorPack(255,255,255,192));
}
}
示例4: renderOverlay
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event)
{
if (event.type == ElementType.ALL)
{
if (overlayFramebuffer == null)
{
overlayFramebuffer = new GXFramebuffer(128, 128);
}
if (gx == null)
{
return;
}
overlayFramebuffer.bind();
gx.render((int)(128), (int)(128));
overlayFramebuffer.unbind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
overlayFramebuffer.bindTexture();
RenderUtils.setColor(255, 255, 255);
RenderUtils.texturedRectangle(0, 0, 128, 128, 0F, 1F, 1F, 0F);
overlayFramebuffer.unbindTexture();
}
}
示例5: renderFramebuffersOverlay
@SubscribeEvent
public void renderFramebuffersOverlay(RenderGameOverlayEvent.Post event)
{
if (event.type != ElementType.ALL) return;
//cleanse monitor list
Iterator<WeakReference<ComponentMonitor>> iter = monitors.iterator();
while (iter.hasNext())
{
WeakReference<ComponentMonitor> w = iter.next();
if (w.get() == null)
{
iter.remove();
}
else
{
ComponentMonitor ex = (ComponentMonitor) w.get();
if (ex.fb != null && ex.owner != null)
{
ex.fb.bind();
ex.owner.gx.render(ex.width, ex.height);
ex.fb.unbind();
}
}
}
}
示例6: onRenderOverlayPostEvent
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderOverlayPostEvent(RenderGameOverlayEvent.Post event) {
if (event.getType() == ElementType.ALL) {
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayer player = minecraft.player;
if (player.getHeldItem(EnumHand.OFF_HAND).getItem() instanceof IInfernalPowerItem) {
int maxPower = player.getHeldItem(EnumHand.OFF_HAND).getMaxDamage();
int power = maxPower - player.getHeldItem(EnumHand.OFF_HAND).getItemDamage();
int width = event.getResolution().getScaledWidth();
int height = event.getResolution().getScaledHeight();
GuiIngame gui = Minecraft.getMinecraft().ingameGUI;
Minecraft.getMinecraft().getTextureManager().bindTexture(HUD_TEXTURE);
GlStateManager.enableBlend();
int y = (height / 2) - (42 / 2);
int x = 3;
int barHeight = (int) (((float) power / (float) maxPower) * 32);
gui.drawTexturedModalRect(x, y, 0, 0, 10, 42);
gui.drawTexturedModalRect(x + 1, y + 5 + (32 - barHeight), 10, 5, 8, barHeight);
Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.ICONS);
GlStateManager.disableBlend();
}
}
}
示例7: onDrawScreenPost
@SubscribeEvent
public static void onDrawScreenPost(RenderGameOverlayEvent.Post event)
{
Minecraft mc = Minecraft.getMinecraft();
if (event.getType() == ElementType.ALL)
{
EntityPlayer player = net.minecraft.client.Minecraft.getMinecraft().player;
// a chance to do great things in the realm of huds
}
}
示例8: renderBar
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.BOTTOM)
public static void renderBar(RenderGameOverlayEvent.Pre event) {
if (SingleProjection.isProjectionState()) {
markEventCanceled(event);
HUDManager.setupOverlayRendering();
} else if (event.getType() == ElementType.ALL)
HUDManager.render();
}
示例9: onRenderBar
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderBar(RenderGameOverlayEvent event) {
if (event.isCancelable() || event.type != ElementType.ALL || mc.thePlayer.getHeldItem() == null ||
!(mc.thePlayer.getHeldItem().getItem() instanceof IMagicalItem)) {
return;
}
IMagicalItem f = (IMagicalItem) mc.thePlayer.getHeldItem().getItem();
// Starting position for the buff bar - 2 pixels from the top left corner.
int xPos = 2;
int yPos = 100;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("dynamiccraft", "textures/gui/magic.png"));
this.drawTexturedModalRect(xPos, yPos, 6, 0, 5, 70);
int i1;
if (f.getMagic(mc.thePlayer.getHeldItem()) > 0) {
i1 = f.getMagic(mc.thePlayer.getHeldItem()) * 70 / f.getMaxMagic(mc.thePlayer.getHeldItem());
this.drawTexturedModalRect(xPos, yPos + 70 - i1, 0, 70 - i1, 5, i1);
}
}
示例10: onRenderExperienceBar
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if (event.isCancelable() || event.type != ElementType.ALL)
return;
LocX = ConfigBaublesHud.hudPositionX;
LocY = ConfigBaublesHud.hudPositionY;
isVertical = ConfigBaublesHud.isVertical;
scale = ConfigBaublesHud.hudScale;
if(isVertical == 0)
{
LocOffsetY = 15;
LocOffsetX = 0;
}
if(isVertical == 1)
{
LocOffsetY = 0;
LocOffsetX = 15;
}
if (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiHud) && !mc.gameSettings.showDebugInfo)
{
if(ConfigBaublesHud.enable == 0)
drawBaublesHudIcons(event.resolution);
}
}
示例11: onRenderGameOverlayPost
@SubscribeEvent
public void onRenderGameOverlayPost(RenderGameOverlayEvent.Post event)
{
if (event.getType() == ElementType.ALL && State.getHideGui() == false)
{
this.renderHud();
}
}
示例12: onRenderGameOverlay
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event)
{
if (event.getType() != ElementType.ALL)
{
return;
}
if ((this.mc.currentScreen instanceof GuiChat) == false && this.mc.player != null)
{
this.buildersWandRenderer.renderHud(this.mc.player);
this.rulerRenderer.renderHud();
this.renderPlacementPropertiesHud(this.mc.player);
}
}
示例13: onRenderGameOverlay
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Pre evt) {
if (evt.type == ElementType.ALL) {
GuiScreen gui = FMLClientHandler.instance().getClient().currentScreen;
if (gui instanceof GuiCapture) {
final GuiCapture capture = (GuiCapture)gui;
// this must be here, since there are some elements (like food bar) that are overriden every tick
capture.forceGuiElementsState();
}
}
}
示例14: renderOverlay
@SubscribeEvent
public void renderOverlay(@Nonnull RenderGameOverlayEvent.Post event) {
ItemStack equippedWrench = getEquippedWrench();
if (event.getType() == ElementType.ALL && Prep.isValid(equippedWrench)) {
doRenderOverlay(event, equippedWrench);
}
}
示例15: renderOverlay
@SubscribeEvent
public void renderOverlay(@Nonnull RenderGameOverlayEvent.Post event) {
ItemStack equippedProbe = getEquippedProbe();
if (event.getType() == ElementType.ALL && Prep.isValid(equippedProbe)) {
doRenderOverlay(event, equippedProbe);
}
}