Java Code Examples for net.minecraft.client.gui.screen.Screen#fill()
The following examples show how to use
net.minecraft.client.gui.screen.Screen#fill() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Peek.java From bleachhack-1.14 with GNU General Public License v3.0 | 6 votes |
public void drawMapToolTip(Slot slot, int mX, int mY) { if (slot.getStack().getItem() != Items.FILLED_MAP) return; MapState data = FilledMapItem.getMapState(slot.getStack(), mc.world); byte[] colors = data.colors; double size = getSettings().get(3).toSlider().getValue(); GL11.glPushMatrix(); GL11.glScaled(size, size, 1.0); GL11.glTranslatef(0.0F, 0.0F, 300.0F); int x = (int) (mX*(1/size) + 12*(1/size)); int y = (int) (mY*(1/size) - 12*(1/size) - 140); renderTooltipBox(x - 12, y + 12, 128, 128, false); for (byte c: colors) { int c1 = c & 255; if (c1 / 4 != 0) Screen.fill(x, y, x+1, y+1, getRenderColorFix(MaterialColor.COLORS[c1 / 4].color, c1 & 3)); if (x - (int) (mX*(1/size)+12*(1/size)) == 127) { x = (int) (mX*(1/size)+12*(1/size)); y++; } else x++; } GL11.glPopMatrix(); }
Example 2
Source File: Peek.java From bleachhack-1.14 with GNU General Public License v3.0 | 6 votes |
public void drawMapToolTip(MatrixStack matrix, Slot slot, int mX, int mY) { if (slot.getStack().getItem() != Items.FILLED_MAP) return; MapState data = FilledMapItem.getMapState(slot.getStack(), mc.world); byte[] colors = data.colors; double size = getSettings().get(3).toSlider().getValue(); GL11.glPushMatrix(); GL11.glScaled(size, size, 1.0); GL11.glTranslatef(0.0F, 0.0F, 300.0F); int x = (int) (mX*(1/size) + 12*(1/size)); int y = (int) (mY*(1/size) - 12*(1/size) - 140); renderTooltipBox(x - 12, y + 12, 128, 128, false); for (byte c: colors) { int c1 = c & 255; if (c1 / 4 != 0) Screen.fill(matrix, x, y, x+1, y+1, getRenderColorFix(MaterialColor.COLORS[c1 / 4].color, c1 & 3)); if (x - (int) (mX*(1/size)+12*(1/size)) == 127) { x = (int) (mX*(1/size)+12*(1/size)); y++; } else x++; } GL11.glPopMatrix(); }
Example 3
Source File: BleachMainMenu.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void render(int p_render_1_, int p_render_2_, float p_render_3_) { //if (windows.get(0).x1 != width / 8 || windows.get(0).y1 != height / 8) minecraft.openScreen(new BleachMainMenu()); this.renderBackground(); fill(0, 0, width, height, 0xff008080); int copyWidth = this.font.getStringWidth("Copyright Mojang AB. Do not distribute!") + 2; font.drawWithShadow("Copyright Mojang AB. Do not distribute!", width - copyWidth, height - 24, -1); font.drawWithShadow("Fabric: " + FabricLoader.getInstance().getModContainer("fabricloader").get().getMetadata().getVersion().getFriendlyString(), 4, height - 44, -1); font.drawWithShadow("Minecraft " + SharedConstants.getGameVersion().getName(), 4, height - 34, -1); font.drawWithShadow("Logged in as: §a" + minecraft.getSession().getUsername(), 4, height - 24, -1); try { if (Integer.parseInt(versions.get(1)) > BleachHack.INTVERSION) { drawCenteredString(this.font, "§cOutdated BleachHack Version!", width/2, 2, -1); drawCenteredString(this.font,"§4[" + versions.get(0) + " > " + BleachHack.VERSION + "]", width/2, 11, -1); } } catch (Exception e) { } drawButton("", 0, height - 14, width, height); drawButton("§cX", 0, height - 13, 20, height - 1); int wid = 20; for (Window w: windows) { if (w.closed) continue; Screen.fill(wid, height - 13, wid + 80 - 1, height - 1 - 1, 0xffb0b0b0); Screen.fill(wid + 1, height - 13 + 1, wid + 80, height - 1, 0xff000000); Screen.fill(wid + 1, height - 13 + 1, wid + 80 - 1, height - 1 - 1, (w.selected ? 0xffb0b0b0 : 0xff858585)); font.draw(w.title, wid + 2, height - 11, 0x000000); wid += 80; } super.render(p_render_1_, p_render_2_, p_render_3_); particleMang.addParticle(p_render_1_, p_render_2_); particleMang.renderParticles(); }
Example 4
Source File: Window.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void render(MatrixStack matrix, int mX, int mY) { TextRenderer textRend = MinecraftClient.getInstance().textRenderer; if (dragging) { x2 = (x2 - x1) + mX - dragOffX; y2 = (y2 - y1) + mY - dragOffY; x1 = mX - dragOffX; y1 = mY - dragOffY; } drawBar(matrix, mX, mY, textRend); for (WindowButton w: buttons) { int bx1 = x1 + w.x1; int by1 = y1 + w.y1; int bx2 = x1 + w.x2; int by2 = y1 + w.y2; Screen.fill(matrix, bx1, by1, bx2 - 1, by2 - 1, 0xffb0b0b0); Screen.fill(matrix, bx1 + 1, by1 + 1, bx2, by2, 0xff000000); Screen.fill(matrix, bx1 + 1, by1 + 1, bx2 - 1, by2 - 1, selected && mX >= bx1 && mX <= bx2 && mY >= by1 && mY <= by2 ? 0xff959595 : 0xff858585); textRend.drawWithShadow(matrix, w.text, bx1 + (bx2 - bx1) / 2 - textRend.getWidth(w.text) / 2, by1 + (by2 - by1) / 2 - 4, -1); } /* window icon */ if (icon != null && selected) { GL11.glPushMatrix(); GL11.glScaled(0.55, 0.55, 1); DiffuseLighting.enableGuiDepthLighting(); MinecraftClient.getInstance().getItemRenderer().renderGuiItemIcon(icon, (int)((x1 + 3) * 1/0.55), (int)((y1 + 3) * 1/0.55)); GL11.glPopMatrix(); } /* window title */ textRend.drawWithShadow(matrix, title, x1 + (icon == null || !selected || icon.getItem() == Items.AIR ? 4 : 15), y1 + 3, -1); }
Example 5
Source File: ModuleWindow.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
private void drawModeSetting(SettingMode s, int x, int y) { Screen.fill(x, y, x+len2, y+10, 0x70000000); screen.drawString(font, "| " + s.text + s.modes[s.mode],x+2, y+1, mouseOver(x, y, x+len2, y+10) ? 0xffc3ff : 0xffe0ff); if (mouseOver(x, y, x+len2, y+10) && lmDown) s.mode = s.getNextMode(); }
Example 6
Source File: ModuleWindowLight.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawToggleSetting(SettingToggle s, int x, int y) { int color; String color2; if (s.state) { if (mouseOver(x, y, x+len, y+12)) {color = 0x9020ff20; color2 = "§2";} else {color = 0x7020ff20; color2 = "§a";} } else { if (mouseOver(x, y, x+len, y+12)) {color = 0x90ff2020; color2 = "§4";} else {color = 0x70ff2020; color2 = "§c";} } Screen.fill(x, y, x+len, y+12, 0x70000000); Screen.fill(x, y, x+1, y+12, color); font.drawWithShadow(color2 + s.text, x+3, y+2, -1); if (mouseOver(x, y, x+len, y+12) && lmDown) s.state = !s.state; }
Example 7
Source File: ModuleWindowLight.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawModeSetting(SettingMode s, int x, int y) { Screen.fill(x, y, x+len, y+12, 0x70000000); font.drawWithShadow(s.text + s.modes[s.mode],x+2, y+2, mouseOver(x, y, x+len, y+12) ? 0xffc3ff : 0xffe0ff); if (mouseOver(x, y, x+len, y+12) && lmDown) s.mode = s.getNextMode(); }
Example 8
Source File: ModuleWindowDark.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawModeSetting(SettingMode s, int x, int y) { Screen.fill(x, y, x+len, y+12, 0x70000000); font.drawWithShadow(s.text + s.modes[s.mode],x+2, y+2, mouseOver(x, y, x+len, y+12) ? 0xcfc3cf : 0xcfe0cf); if (mouseOver(x, y, x+len, y+12) && lmDown) s.mode = s.getNextMode(); }
Example 9
Source File: ClickGuiScreen.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawBindSetting(MatrixStack matrix, Module m, int key, int x, int y) { Screen.fill(matrix, x, y+11, x+len-2, y+12, 0x90b0b0b0); Screen.fill(matrix, x+len - 2, y, x+len-1, y+12, 0x90b0b0b0); Screen.fill(matrix, x, y - 1, x + 1, y+11, 0x90000000); if (key != -1 && mouseOver(x, y, x+len, y+12)) m.setKey((key != 261 && key != 256) ? key : -1); String name = InputUtil.fromKeyCode(m.getKey(), -1).getLocalizedText().getString(); if (name == null) name = "KEY" + m.getKey(); if (name.isEmpty()) name = "NONE"; textRenderer.drawWithShadow(matrix, "Bind: " + name + (mouseOver(x, y, x+len, y+12) ? "..." : "") , x+2, y+2, mouseOver(x, y, x+len, y+12) ? 0xcfc3cf : 0xcfe0cf); }
Example 10
Source File: BleachMainMenu.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void render(int p_render_1_, int p_render_2_, float p_render_3_) { this.renderBackground(); fill(0, 0, width, height, 0xff008080); int copyWidth = this.font.getStringWidth("Copyright Mojang AB. Do not distribute!") + 2; font.drawWithShadow("Copyright Mojang AB. Do not distribute!", width - copyWidth, height - 24, -1); font.drawWithShadow("Fabric: " + FabricLoader.getInstance().getModContainer("fabricloader").get().getMetadata().getVersion().getFriendlyString(), 4, height - 44, -1); font.drawWithShadow("Minecraft " + SharedConstants.getGameVersion().getName(), 4, height - 34, -1); font.drawWithShadow("Logged in as: §a" + minecraft.getSession().getUsername(), 4, height - 24, -1); try { if (Integer.parseInt(versions.get(1)) > BleachHack.INTVERSION) { drawCenteredString(this.font, "§cOutdated BleachHack Version!", width/2, 2, -1); drawCenteredString(this.font,"§4[" + versions.get(0) + " > " + BleachHack.VERSION + "]", width/2, 11, -1); } } catch (Exception e) { } drawButton("", 0, height - 14, width, height); drawButton("§cX", 0, height - 13, 20, height - 1); int wid = 20; for (Window w: windows) { if (w.closed) continue; Screen.fill(wid, height - 13, wid + 80 - 1, height - 1 - 1, 0xffb0b0b0); Screen.fill(wid + 1, height - 13 + 1, wid + 80, height - 1, 0xff000000); Screen.fill(wid + 1, height - 13 + 1, wid + 80 - 1, height - 1 - 1, (w.selected ? 0xffb0b0b0 : 0xff858585)); font.draw(w.title, wid + 2, height - 11, 0x000000); wid += 80; } super.render(p_render_1_, p_render_2_, p_render_3_); particleMang.addParticle(p_render_1_, p_render_2_); particleMang.renderParticles(); }
Example 11
Source File: ModuleWindowFuture.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawBindSetting(Module m, int key, int x, int y) { Screen.fill(x, y, x+len, y+14, mouseOver(x, y, x+len, y+14) ? 0x70303030 : 0x70000000); if (key != -1 && mouseOver(x, y, x+len, y+14)) m.setKey((key != 261 && key != 256) ? key : -1); String name = InputUtil.getKeycodeName(m.getKey()); if (name == null) name = "KEY" + m.getKey(); if (name.isEmpty()) name = "NONE"; font.drawWithShadow("Bind §7" + name + (mouseOver(x, y, x+len, y+14) ? "..." : "") , x+2, y+3, -1); }
Example 12
Source File: ModuleWindow.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void drawSliderSetting(SettingSlider s, int x, int y) { int pixels = (int) Math.round(MathHelper.clamp(len2*((s.getValue() - s.min) / (s.max - s.min)), 0, len2)); Screen.fill(x, y, x+len2, y+10, 0x70000000); Screen.fill(x, y, x+pixels, y+10, 0xf03080a0); screen.drawString(font, "| " + s.text + s.value, x+2, y+1, mouseOver(x, y, x+len2, y+10) ? 0xffc3ff : 0xffe0ff); if (mouseOver(x, y, x+len2, y+10) && lmDown) { int percent = ((mouseX - x) * 100) / len2; s.value = s.round(percent*((s.max - s.min) / 100) + s.min, s.round); } }
Example 13
Source File: ModuleWindow.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void fillGrey(int x1, int y1, int x2, int y2) { Screen.fill(x1, y1, x1 + 1, y2 - 1, 0x90b0b0b0); Screen.fill(x1 + 1, y1, x2 - 1, y1 + 1, 0x90b0b0b0); Screen.fill(x1 + 1, y2 - 1, x2, y2, 0x90000000); Screen.fill(x2 - 1, y1 + 1, x2, y2, 0x90000000); Screen.fill(x1 + 1, y1 + 1, x2 - 1, y2 - 1, 0xff505059); }
Example 14
Source File: ClickGuiScreen.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void fillGreySides(MatrixStack matrix, int x1, int y1, int x2, int y2) { Screen.fill(matrix, x1, y1, x1 + 1, y2 - 1, 0x90000000); Screen.fill(matrix, x2 - 1, y1 + 1, x2, y2, 0x90b0b0b0); }
Example 15
Source File: ModuleWindowLight.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void draw(int mX, int mY, int leng) { mouseX = mX; mouseY = mY; len = leng; font = MinecraftClient.getInstance().textRenderer; Screen.fill(posX, posY-10, posX+len, posY, mouseOver(posX, posY-10, posX+len, posY) ? 0x704060cf : 0x704040ff); font.drawWithShadow(name, posX+(len/2)-(font.getStringWidth(name)/2), posY-9, 0xffaaff); /* window dragging */ if (mouseOver(posX, posY-10, posX+len, posY)) { if (rmDown) hiding = !hiding; if (lmDown) dragging = true; } if (!lmHeld) dragging = false; if (dragging) { posX = mouseX-(prevmX - posX); posY = mouseY-(prevmY - posY); } prevmX = mouseX; prevmY = mouseY; /* Draw Modules */ if (hiding) { font.drawWithShadow("-", posX+len-8, posY-9, 0xffaaff); return; } else font.drawWithShadow("+", posX+len-8, posY-9, 0xffaaff); int count = 0; for (Entry<Module, Boolean> m: new LinkedHashMap<>(mods).entrySet()) { Screen.fill(posX, posY+(count*12), posX+len, posY+12+(count*12), mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12)) ? 0x70303070 : 0x70000000); font.drawWithShadow(cutText(m.getKey().getName(), len), posX+2, posY+2+(count*12), m.getKey().isToggled() ? 0x6060ff : 0xffffff); Screen.fill(m.getValue() ? posX+len-2 : posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), m.getValue() ? 0x9fffffff : 0x5fffffff); /* Set which module settings show on */ if (mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12))) { GL11.glTranslated(0, 0, 300); /* Match lines to end of words */ Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc()); int c2 = 0; int c3 = 0; while(mat.find()) { c2++; } mat.reset(); while(mat.find()) { Screen.fill(posX+len+3, posY-1+(count*12)-(c2 * 10)+(c3 * 10), posX+len+6+font.getStringWidth(mat.group().trim()), posY+(count*12)-(c2 * 10)+(c3 * 10)+9, 0x90000000); font.drawWithShadow(mat.group(), posX+len+5, posY+(count*12)-(c2 * 10)+(c3 * 10), -1); c3++; } if (lmDown) m.getKey().toggle(); if (rmDown) mods.replace(m.getKey(), !m.getValue()); if (lmDown || rmDown) MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F)); GL11.glTranslated(0, 0, -300); } /* draw settings */ if (m.getValue()) { for (SettingBase s: m.getKey().getSettings()) { count++; if (s instanceof SettingMode) drawModeSetting(s.toMode(), posX, posY+(count*12)); if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), posX, posY+(count*12)); if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), posX, posY+(count*12)); Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9fffffff); } count++; drawBindSetting(m.getKey(), keyDown, posX, posY+(count*12)); Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9fffffff); } count++; } lmDown = false; rmDown = false; keyDown = -1; }
Example 16
Source File: ModuleWindowFuture.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void drawModeSetting(SettingMode s, int x, int y) { Screen.fill(x, y, x+len, y+14, mouseOver(x, y, x+len, y+14) ? 0x70303030 : 0x70000000); font.drawWithShadow(s.text + "§7" + s.modes[s.mode],x+2, y+3, -1); if (mouseOver(x, y, x+len, y+14) && lmDown) s.mode = s.getNextMode(); }
Example 17
Source File: AbstractWindowScreen.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void drawButton(String text, int x1, int y1, int x2, int y2) { Screen.fill(x1, y1, x2 - 1, y2 - 1, 0xffb0b0b0); Screen.fill(x1 + 1, y1 + 1, x2, y2, 0xff000000); Screen.fill(x1 + 1, y1 + 1, x2 - 1, y2 - 1, 0xff858585); drawCenteredString(font, text, x1 + (x2 - x1) / 2, y1 + (y2 - y1) / 2 - 4, -1); }
Example 18
Source File: ClickGuiScreen.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void fillReverseGrey(int x1, int y1, int x2, int y2) { Screen.fill(x1, y1, x1 + 1, y2 - 1, 0x90000000); Screen.fill(x1 + 1, y1, x2 - 1, y1 + 1, 0x90000000); Screen.fill(x2 - 2, y1 + 1, x2, y2, 0x90b0b0b0); }
Example 19
Source File: ModuleWindowDark.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void draw(int mX, int mY, int leng) { mouseX = mX; mouseY = mY; len = leng; font = MinecraftClient.getInstance().textRenderer; Screen.fill(posX, posY-10, posX+len, posY, mouseOver(posX, posY-10, posX+len, posY) ? 0x90101010 : 0x90303030); font.drawWithShadow(name, posX+(len/2)-(font.getStringWidth(name)/2), posY-9, 0x70afa0); /* window dragging */ if (mouseOver(posX, posY-10, posX+len, posY)) { if (rmDown) hiding = !hiding; if (lmDown) dragging = true; } if (!lmHeld) dragging = false; if (dragging) { posX = mouseX-(prevmX - posX); posY = mouseY-(prevmY - posY); } prevmX = mouseX; prevmY = mouseY; /* Draw Modules */ if (hiding) { font.drawWithShadow("-", posX+len-8, posY-9, 0x70afa0); return; } else font.drawWithShadow("+", posX+len-8, posY-9, 0x70afa0); int count = 0; for (Entry<Module, Boolean> m: new LinkedHashMap<>(mods).entrySet()) { Screen.fill(posX, posY+(count*12), posX+len, posY+12+(count*12), mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12)) ? 0x70303070 : 0x70000000); font.drawWithShadow(cutText(m.getKey().getName(), len), posX+2, posY+2+(count*12), m.getKey().isToggled() ? 0x70efe0 : 0xc0c0c0); Screen.fill(m.getValue() ? posX+len-2 : posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), m.getValue() ? 0x9f70fff0 : 0x5f70fff0); /* Set which module settings show on */ if (mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12))) { GL11.glTranslated(0, 0, 300); /* Match lines to end of words */ Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc()); int c2 = 0; int c3 = 0; while(mat.find()) { c2++; } mat.reset(); while(mat.find()) { Screen.fill(posX+len+3, posY-1+(count*12)-(c2 * 10)+(c3 * 10), posX+len+6+font.getStringWidth(mat.group().trim()), posY+(count*12)-(c2 * 10)+(c3 * 10)+9, 0x90000000); font.drawWithShadow(mat.group(), posX+len+5, posY+(count*12)-(c2 * 10)+(c3 * 10), -1); c3++; } if (lmDown) m.getKey().toggle(); if (rmDown) mods.replace(m.getKey(), !m.getValue()); if (lmDown || rmDown) MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F)); GL11.glTranslated(0, 0, -300); } /* draw settings */ if (m.getValue()) { for (SettingBase s: m.getKey().getSettings()) { count++; if (s instanceof SettingMode) drawModeSetting(s.toMode(), posX, posY+(count*12)); if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), posX, posY+(count*12)); if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), posX, posY+(count*12)); Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9f70fff0); } count++; drawBindSetting(m.getKey(), keyDown, posX, posY+(count*12)); Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9f70fff0); } count++; } lmDown = false; rmDown = false; keyDown = -1; }
Example 20
Source File: AbstractWindowScreen.java From bleachhack-1.14 with GNU General Public License v3.0 | 4 votes |
public void drawButton(String text, int x1, int y1, int x2, int y2) { Screen.fill(x1, y1, x2 - 1, y2 - 1, 0xffb0b0b0); Screen.fill(x1 + 1, y1 + 1, x2, y2, 0xff000000); Screen.fill(x1 + 1, y1 + 1, x2 - 1, y2 - 1, 0xff858585); drawCenteredString(font, text, x1 + (x2 - x1) / 2, y1 + (y2 - y1) / 2 - 4, -1); }