TreetopFlyer Posted August 11, 2013 Posted August 11, 2013 Very noob question-- I can't figure out how to point the rendering engine to a texture in the filesystem. As bindTexture is depreciated, apparently its now done like this with func_110577_a(?): ResourceLocation rl = new ResourceLocation("path/to/rasterImage.png"); Minecraft.getMinecraft().renderEngine.func_110577_a(rl); Anyway, where, in the filesystem, is the compiler(or is it the runtime?) looking for rasterImage.png? When I run the above snippet with "textures/entity/arrow.png" as the argument for the ResourceLocation constructor, (something I found in another class) it works, but I don't know why, or where it found that image, or how to supply my own image. Quote
hydroflame Posted August 11, 2013 Posted August 11, 2013 search for "hydroflame guide to texture" in the wiki Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
TreetopFlyer Posted August 11, 2013 Author Posted August 11, 2013 thank you!! you spelled that out perfectly! could not ask for more. http://www.minecraftforge.net/wiki/Hydroflame_guide_to_textures Quote
TreetopFlyer Posted August 11, 2013 Author Posted August 11, 2013 ERR wait a second, im following your guide very closely. At the very bottom it says: ResourceLocation myImage = new ResourceLocation("genericmodid", "you/can/use/any/path/theImage.png"); So, I have in my code a static member of the class MyClass (implements IItemRenderer) as the resource like this: private static ResourceLocation RL = new ResourceLocation("MyMod", "test.png"); And in the MyClass render routine I'm calling: Minecraft.getMinecraft().renderEngine.func_110577_a(MyClass.RL); and in the filesystem I have a png like this: mcp/src/minecraft/assets/test.png but still get this runtime exception: [WARNING] [Minecraft-Client] Failed to load texture: MyMod:test.png Quote
hydroflame Posted August 11, 2013 Posted August 11, 2013 src/minecraft/assets/*modid*/test.png Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
TreetopFlyer Posted August 11, 2013 Author Posted August 11, 2013 ok in the filesystem i added the extra folder (named after the modid) in the assets directory and moved the image in there like you indicated, but still no dice. to re-cap, i have the filesystem setup like this: mcp/src/minecraft/assets/MyMod/test.png and the ResourceLocation code is unchanged: private static ResourceLocation RL = new ResourceLocation("MyMod", "test.png"); Quote
hydroflame Posted August 11, 2013 Posted August 11, 2013 caps are not allowed for mod ids Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
TreetopFlyer Posted August 11, 2013 Author Posted August 11, 2013 ok ok looks like that got rid of the exception! the item (this is for an item renderer) is invisible. test.png is a solid orange block, 32x32. if i change the path back to that factory arrow texture, i can see it show up on parts of the item. But this test texture, even though it is a solid color, never shows up. is 32x32 an illegal size? Quote
TreetopFlyer Posted August 11, 2013 Author Posted August 11, 2013 ok seems to be a techne model issue of some sort. i was able to pull the test.png texture in and render it on the arrow geometry i ganked from somewhere else. I'll see if I can't fix it from here. Thanks Hydroflame for all your help! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.