Java Code Examples for net.minecraftforge.fml.client.config.GuiUtils#drawContinuousTexturedBox()

The following examples show how to use net.minecraftforge.fml.client.config.GuiUtils#drawContinuousTexturedBox() . 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: ComponentRenderer.java    From AgriCraft with MIT License 5 votes vote down vote up
public static void renderComponentProgressBar(AgriGuiWrapper gui, GuiComponent<Supplier<Integer>> component) {
    final int width = component.getBounds().width;
    final int height = component.getBounds().height;
    final double progress = MathHelper.inRange(component.getComponent().get(), 0.0, 100.0);
    GuiUtils.drawContinuousTexturedBox(WIDGETS, 0, 0, 100, 25, width, height, 16, 16, 2, 0);
    GuiUtils.drawContinuousTexturedBox(WIDGETS, 0, 0, 125, 25, (int) ((width * progress) / 100), height, 16, 16, 2, 0);
}
 
Example 2
Source File: GuiSlider.java    From WearableBackpacks with MIT License 5 votes vote down vote up
/** Draws the slider bar. */
protected void drawSliderBar(boolean isHighlighted, float partialTicks) {
	int sliderSize = getSliderSize();
	boolean slideHorizontal = directions.contains(Direction.HORIZONTAL);
	boolean slideVertical   = directions.contains(Direction.VERTICAL);
	int x = slideHorizontal ? (int)((getWidth()  - sliderSize) * getSliderRawX()) : 0;
	int y = slideVertical   ? (int)((getHeight() - sliderSize) * getSliderRawY()) : 0;
	int w = slideHorizontal ? sliderSize : getWidth();
	int h = slideVertical   ? sliderSize : getHeight();
	int ty = isEnabled() ? 66 : 46;
	GuiUtils.drawContinuousTexturedBox(GuiButton.BUTTON_TEX, x, y, 0, ty, w, h,
	                                   DEFAULT_WIDTH, DEFAULT_HEIGHT, 2, 3, 2, 2, 0);
}
 
Example 3
Source File: GuiButton.java    From WearableBackpacks with MIT License 5 votes vote down vote up
/** Draws the actual button texture. */
protected void drawButtonBackground(boolean isHighlighted, float partialTicks) {
	int buttonIndex = !isEnabled() ? 0
	                : !isHighlighted ? 1
	                : 2;
	int ty = 46 + buttonIndex * 20;
	GuiUtils.drawContinuousTexturedBox(BUTTON_TEX, 0, 0, 0, ty, getWidth(), getHeight(),
	                                   DEFAULT_WIDTH, DEFAULT_HEIGHT, 2, 3, 2, 2, 0);
}
 
Example 4
Source File: ComponentRenderer.java    From AgriCraft with MIT License 4 votes vote down vote up
public static void renderComponentButton(AgriGuiWrapper gui, GuiComponent<String> component) {
    GuiUtils.drawContinuousTexturedBox(WIDGETS, 0, 0, 0, 46 + getButtonNumber(component) * 20, component.getBounds().width, component.getBounds().height, 200, 20, 2, 3, 2, 2, 0);
    ComponentRenderer.renderComponentText(gui, component, getTextColor(component), true);
}
 
Example 5
Source File: ComponentRenderer.java    From AgriCraft with MIT License 4 votes vote down vote up
public static void renderStackFrame(AgriGuiWrapper gui, GuiComponent<ItemStack> component) {
    GuiUtils.drawContinuousTexturedBox(WIDGETS, -1, -1, 142, 25, 18, 18, 18, 18, 2, 0);
}
 
Example 6
Source File: GuiSlider.java    From WearableBackpacks with MIT License 4 votes vote down vote up
/** Draws the slider background. */
protected void drawSliderBackground(boolean isHighlighted, float partialTicks) {
	GuiUtils.drawContinuousTexturedBox(GuiButton.BUTTON_TEX, 0, 0, 0, 46, getWidth(), getHeight(),
	                                   DEFAULT_WIDTH, DEFAULT_HEIGHT, 2, 3, 2, 2, 0);
}