Jump to content

Image increasing size in GUI overlay


CGCM

Recommended Posts

Hi,

 

Image increasing size in GUI overlay:

 

Print: http://i.prntscr.com/tD5jfDL7Rymrwx-ZZ9q03w.png

 

Code:

 

package Thirst;

import java.lang.annotation.ElementType;
import java.util.HashMap;
import java.util.Map;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.MinecraftForge;

@Mod(modid = Main.MODID, version = Main.VERSION)
public class Main {
   
    
      public static final String MODID = "thistmod";
        public static final String VERSION = "1.0.0";
        public static final String CLIENT_PROXY = "Thirst.ClientProxy";
        public static final String COMMON_PROXY = "Thirst.CommonProxy";
        
        @Instance(MODID)
        public static Main instance;
        @SidedProxy(clientSide = CLIENT_PROXY, serverSide = COMMON_PROXY)
        public static CommonProxy proxy;
        
        @EventHandler
        public void load() {
            
        }
         
        @EventHandler
        public void preInit(FMLPreInitializationEvent event)
        {
            
        }
        @EventHandler
        public void Init(FMLInitializationEvent event)
        {
            
        }
        @EventHandler
        public void postInit(FMLPostInitializationEvent event)
        {
            //MinecraftForge.EVENT_BUS.register(new GUIRenderEventClass());
            MinecraftForge.EVENT_BUS.register(new GUIRenderEventClassd());

        }
        public static class GUIRenderEventClassd {
        @SubscribeEvent(priority = EventPriority.NORMAL)
    public void onRenderGameOverlay(RenderGameOverlayEvent event) {
        if(!event.isCancelable() && event.type == net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.EXPERIENCE) {
            Minecraft mc = Minecraft.getMinecraft();
            
            if(!mc.thePlayer.capabilities.isCreativeMode) {
                
                //int posX = (event.resolution.getScaledWidth() / 2)*20;
                //int posY = ((event.resolution.getScaledHeight() / 2)*32) + ((event.resolution.getScaledHeight() /2) *2);
                
                int posX = (event.resolution.getScaledWidth() / 2);
                int posY = (event.resolution.getScaledHeight() / 2);
                
                //GL11.glPushMatrix(); // save the current matrix
                //GL11.glScalef(0.05F, 0.05F, 0.05F); // scale the matrix
                 
                
                
                mc.renderEngine.bindTexture(new ResourceLocation("thistmod:textures/gui/Nhec.png"));
                
                mc.ingameGUI.drawTexturedModalRect(posX, posY, 64,64,112, 128);
              
                //GL11.glPopMatrix(); 
                //GL11.glPushMatrix();
                //GL11.glScalef(0.5F, 0.5F, 0.5F);
                //mc.fontRenderer.drawStringWithShadow("ATA", posX, posY, 0xFFFFFF);
                //GL11.glPopMatrix();
                
            }
        }
     
    }
        }
}

Link to comment
Share on other sites

Um...ok?
Do you have a question or problem you want help with?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.