This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HOW TO DRAW A TEXTURED RECTANGLE IN A MINECRAFT GUI WITH THE TEXTURE SCALED TO FIT | |
// | |
// | |
// 1. You need an instance of RenderEngine. Using ModLoader you can obtain it with: | |
// | |
RenderEngine renderEngine = ModLoader.getMinecraftInstance().renderEngine; | |
// 2a. When your mod first starts, you need to load your texture into OpenGL. If your image | |
// file is on the classpath (i.e. inside minecraft.jar or inside your own mod's jar) then | |
// you can load it easily. Your image file should contain an alpha layer with only 0 or 255 |