本文整理汇总了Java中net.minecraftforge.fml.client.config.GuiUtils.drawContinuousTexturedBox方法的典型用法代码示例。如果您正苦于以下问题:Java GuiUtils.drawContinuousTexturedBox方法的具体用法?Java GuiUtils.drawContinuousTexturedBox怎么用?Java GuiUtils.drawContinuousTexturedBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.client.config.GuiUtils
的用法示例。
在下文中一共展示了GuiUtils.drawContinuousTexturedBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/**
* Draws this button to the screen.
*/
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial){
if (this.visible) {
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
int k = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(FalloutWidgets, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
int color = 15435844;
if (packedFGColour != 0) {
color = packedFGColour;
} else if (!this.enabled) {
color = 5320730;
} else if (this.hovered) {
color = 15465844;
}
String buttonText = this.displayString;
int strWidth = mc.fontRenderer.getStringWidth(buttonText);
int ellipsisWidth = mc.fontRenderer.getStringWidth("...");
if (strWidth > width - 6 && strWidth > ellipsisWidth)
buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
}
}
示例2: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/**
* Draws this button to the screen.
*/
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial){
if (this.visible) {
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
int k = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(FalloutWidgets, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
int color = Color_and_Etc.rawColorFromRGB(ConfigInit.colorR, ConfigInit.colorG, ConfigInit.colorB);
if (packedFGColour != 0) {
color = packedFGColour;
} else if (!this.enabled) {
} else if (this.hovered) {
}
String buttonText = this.displayString;
int strWidth = mc.fontRenderer.getStringWidth(buttonText);
int ellipsisWidth = mc.fontRenderer.getStringWidth("...");
if (strWidth > width - 6 && strWidth > ellipsisWidth)
buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
}
}
示例3: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/** Draws this button to the screen. */
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.boxWidth
&& mouseY < this.yPosition + this.height;
GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.xPosition, this.yPosition, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2,
2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632;
if (packedFGColour != 0) {
color = packedFGColour;
} else if (!this.enabled) {
color = 10526880;
}
if (this.isChecked())
this.drawCenteredString(mc.fontRendererObj, checkStr, this.xPosition + this.boxWidth / 2 + 1, this.yPosition + 1, 14737632);
}
}
示例4: draw
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
@Override
public void draw(int x, int y, int mouseX, int mouseY, float partialTicks) {
GlStateManager.color(1, 1, 1, 1);
hovered = mouseX >= x && mouseY >= y && mouseX < x + 32 && mouseY < y + 16;
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GuiUtils.drawContinuousTexturedBox(buttonLocation, x, y, 0, hovered ? 86 : 66, 32, 16, 200, 20, 3,
partialTicks);
GlStateManager.disableDepth();
Minecraft.getMinecraft().getTextureManager().bindTexture(arrowLocation);
Gui.drawModalRectWithCustomSizedTexture(x + 8, y, isExpanded ? 16 : 0, hovered ? 16 : 0, 16, 16, 32, 32);
GlStateManager.enableDepth();
if (isExpanded)
child.draw(x, y + 18, mouseX, mouseY, partialTicks);
}
示例5: drawGuiContainerBackgroundLayer
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
/*
* Draw Panel + Player Inventory Slots
*/
Minecraft.getMinecraft().getTextureManager().bindTexture(guiTexture);
int offset = Config.dark_theme ? 0 : 44;
GuiUtils.drawContinuousTexturedBox(guiLeft, guiTop, offset, 0, ContainerAdvancedMachine.panelWidth, ContainerAdvancedMachine.panelHeight, 44, 44, 20, 0);
offset = Config.dark_theme ? 134 : 44;
drawTexturedModalRect(guiLeft + ContainerAdvancedMachine.panelWidth / 2 - 176 / 2, guiTop + ContainerAdvancedMachine.panelHeight - 3, 0, offset, 176, 90);
/*
* Draw app background
*/
if (machineContainer.activeApp != null) {
machineContainer.activeApp.gui.drawBackground(this, partialTicks, mouseX, mouseY);
}
}
示例6: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial) {
if (this.visible) {
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
int k = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
GlStateManager.pushMatrix();
if (this.icon.isEmpty()) {
this.icon = new ItemStack(Blocks.STONE);
}
ItemRenderHelper.renderItem(this.x + this.width / 2, this.y + this.height / 2, icon);
GlStateManager.popMatrix();
}
}
示例7: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
int state = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46 + state * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
int amt = 1;
if (mode == 1)
amt = 64;
else
amt = 1;
ItemStack stack = new ItemStack(Blocks.STONE, amt, 0);
GlStateManager.pushMatrix();
GlStateManager.translate(this.x, this.y, 0.0);
GlStateManager.scale(0.9F, 0.9F, 0.9F);
GlStateManager.translate(-this.x, -this.y, 0.0);
RenderHelper.disableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
mc.getRenderItem().renderItemAndEffectIntoGUI(stack, this.x + 3, this.y + 3);
RenderHelper.enableStandardItemLighting();
GlStateManager.popMatrix();
mc.getRenderItem().renderItemOverlays(mc.fontRenderer, stack, this.x + 2, this.y + 2);
}
示例8: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/**
* Draws this button to the screen.
*/
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial)
{
if (this.visible)
{
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.boxWidth && mouseY < this.y + this.height;
GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
int color = this.stringColor;
if (packedFGColour != 0)
{
color = packedFGColour;
}
else if (!this.enabled)
{
color = 10526880;
}
if (this.isChecked())
{
this.drawCenteredString(mc.fontRenderer, "x", this.x + this.boxWidth / 2 + 1, this.y + 1, 14737632);
}
if (this.withShadow)
{
this.drawString(mc.fontRenderer, displayString, x + this.boxWidth + 2, y + 2, color);
}
else
{
mc.fontRenderer.drawString(displayString, x + this.boxWidth + 2, y + 2, color);
}
}
}
示例9: renderComponentProgressBar
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
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);
}
示例10: drawSliderBar
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/** 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);
}
示例11: drawButtonBackground
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/** 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);
}
示例12: drawButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial)
{
if (this.visible)
{
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
int k = this.getHoverState(this.hovered);
// Set the "hover" color if this is a selected button.
if (this.selected)
{
k = 2;
}
GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632;
if (packedFGColour != 0)
{
color = packedFGColour;
}
else if (!this.enabled)
{
color = 10526880;
}
else if (this.hovered || this.selected)
{
color = 16777120;
}
String buttonText = this.displayString;
int strWidth = mc.fontRenderer.getStringWidth(buttonText);
int ellipsisWidth = mc.fontRenderer.getStringWidth("...");
if (strWidth > width - 6 && strWidth > ellipsisWidth)
buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
}
}
示例13: renderComponentButton
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
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);
}
示例14: renderStackFrame
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
public static void renderStackFrame(AgriGuiWrapper gui, GuiComponent<ItemStack> component) {
GuiUtils.drawContinuousTexturedBox(WIDGETS, -1, -1, 142, 25, 18, 18, 18, 18, 2, 0);
}
示例15: drawSliderBackground
import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
/** 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);
}