Posted March 14, 20169 yr I would like my GUI Texture to be stretched instead of tiled like it is in the picture linked below. https://drive.google.com/file/d/0BzAK31wMCRFrSTkxd3VKamJ6MEU/view The code is at https://github.com/theMusicalGamer/skywardSwordMod.git. Any help is appreciated!
March 15, 20169 yr Author So, now I understand what u and v are. I've changed to using the func_146110_a function because I read somewhere of a function called "drawTexturedModalRectWithCustomTextureSize". Obviously, that's not a valid function name, but I found the actual function. Not getting a tiled texture anymore. I've been playing around with the settings, but now it goes off the screen, or shows other things that aren't what is desired (just the one texture). I've updated the github repo with this new code.
March 16, 20169 yr Author I appreciate your help, however some companion mods for the mod that I am writing aren't being updated to 1.8 and there's not much I can do about that. As for how big I want the rectangle to be, I'd like it to fill the screen (it's at 16:9 aspect ratio).
March 16, 20169 yr You have to make sure youre texture size is a power of 2 (16x16, 32x32 ... 128x128, 256x256). In there you can create an image with an aspect ratio of 16:9, and than only draw that part from the texture, using the u,v coordinates. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
March 17, 20169 yr Author Okay, let me see if I understand. I should make a texture that is a power of two (as you stated), with the desired aspect ratio of 16:9, and then use u and v to only draw the picture as a 16:9 picture?
March 17, 20169 yr Author So, I tried that, and if you check my code (https://github.com/theMusicalGamer/skywardSwordMod.git), I have the "frame" variable print out whenever it draws the screen. For some reason, if you check my logs (which I'll post to the issue on my GitHub repository that I'm creating for this), it will jump from 0 to 164, which is what the frameCap is set for. Any reasons why it would do this?
March 17, 20169 yr Author So, I fixed that problem (however it is still tiled). What was happening was it would update the frame, add 1 to the frame number until it reached the frame cap, and then redraw the screen.
March 18, 20169 yr Any reasons why it would do this? So glad you fixed that problem on you own so I didn't have to call you an idiot. As for the tiling: Your texture is smaller than the screen. In order to stretch it, you need to draw the exact size that fits on the texture to a much larger area. Minecraft's GUI system is set up to draw 1 texture pixel to 2 screen pixels (at default GUI scaling). You might want to take a look at drawTexturedModalRect . 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.
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.