Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Solved] [1.10.2] Potion icon rendering with wrong scale
The update for 1.13 is being worked on - please be patient. (Updated 02/19/19)
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
Choonster

[Solved] [1.10.2] Potion icon rendering with wrong scale

Started by Choonster, July 12, 2016

3 posts in this topic

Choonster    1594

Choonster

Choonster    1594

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1594
  • 4981 posts
  • Report post
Posted July 12, 2016

I've added a potion using this class which overrides

Potion#renderInventoryEffect

and

Potion#renderHUDEffect

to handle the icon rendering itself (imitating the vanilla code). Both overrides use this method (a wrapper around Forge's

GuiUtils.drawTexturedModalRect

) to render the icon.

 

For some reason, just over 1 square pixel of the icon (from the top-left corner) is rendering stretched over 18x18 pixels. What am I doing wrong?

 

Screenshots:

Bc45Pjs.png

GhqTOkk.png

Share this post


Link to post
Share on other sites

diesieben07    6115

diesieben07

diesieben07    6115

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6115
  • 40266 posts
  • Report post
Posted July 12, 2016

drawTexturedModalRect

only supports textures with a size of 256x256 (see the hardcoded

uScale

/

vScale

).

Minecraft's

Gui

class has

drawModalRectWithCustomSizedTexture

, which has parameters for the texture dimensions.

Share this post


Link to post
Share on other sites

Choonster    1594

Choonster

Choonster    1594

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1594
  • 4981 posts
  • Report post
Posted July 12, 2016

That fixed it, thanks.

 

New code is here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0
Go To Topic Listing Modder Support

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DaemonUmbra
      Having trouble launching the client test through eclipse

      By DaemonUmbra · Posted 15 minutes ago

      We will not support the development of hacked clients.
    • Kost
      Server is not working, need help

      By Kost · Posted 17 minutes ago

      A problem occurred running the Server launcher.[22:05:18] [main/INFO] [STDERR]: [net.minecraftforge.fml.relauncher.ServerLaunchWrapper:main:34]: java.lang.reflect.InvocationTargetException
      This is the output i've got after running server with mods
      Here's debug file
      debug.rar
    • DaemonUmbra
      Forge não carrega com o java 8

      By DaemonUmbra · Posted 29 minutes ago

      Yeah, that version isn't supported anymore because it's old, sorry.
    • DaemonUmbra
      cant make modded server

      By DaemonUmbra · Posted 30 minutes ago

      What URL did you download Forge from? If you open a command prompt and type java -version, what pops up?
    • vintin_ls
      Forge não carrega com o java 8

      By vintin_ls · Posted 31 minutes ago

      1.7.10
  • Topics

    • oridos
      1
      Having trouble launching the client test through eclipse

      By oridos
      Started 1 hour ago

    • Kost
      0
      Server is not working, need help

      By Kost
      Started 18 minutes ago

    • vintin_ls
      3
      Forge não carrega com o java 8

      By vintin_ls
      Started 2 hours ago

    • LordTSI
      1
      cant make modded server

      By LordTSI
      Started 32 minutes ago

    • Xenomatrix
      1
      Worlds don't save. Forge version 1.12.2

      By Xenomatrix
      Started 6 hours ago

  • Who's Online (See full list)

    • fieldbox
    • loordgek
    • Davyboy2346
    • jaf04
    • crackedEgg
    • nov4e
    • ahaupt8
    • Kost
    • LexManos
    • DaemonUmbra
    • Nuchaz
    • Floydman
    • PulseBeat_02
    • DarthIF
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Solved] [1.10.2] Potion icon rendering with wrong scale
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community