Advertisement
Guest User

Screen

a guest
Apr 7th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public static void drawRectangleOnScreen(int xPos, int yPos, int rectSizeX, int rectSizeY, int tXPos, int tYPos, GuiScreen gui)
  2.     {
  3.         int screenWidth = 196;
  4.         int screenHeight = 169;
  5.        
  6.         int u = tXPos / screenWidth;
  7.         int v = tYPos / screenHeight;
  8.        
  9.         gui.drawTexturedModalRect(xPos, yPos, u, v, rectSizeY, rectSizeX);
  10.     }
  11.  
  12. // How is this method used:
  13. public class TrialScreen extends GuiScreen{
  14.    
  15.     @Override
  16.     public void drawScreen(int x, int y , float tick)
  17.     {
  18.         int[] screenPos = MainLib.createScreenBase(new int[]{width, height}, "PasswordGui", this);
  19.         MainLib.drawRectangleOnScreen(screenPos[0] + 110, screenPos[1] + 11, 0, 177, 68, 20, this);
  20.         super.drawScreen(x, y, tick);
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement