本文整理汇总了Java中net.minecraft.client.gui.GuiScreen.drawRect方法的典型用法代码示例。如果您正苦于以下问题:Java GuiScreen.drawRect方法的具体用法?Java GuiScreen.drawRect怎么用?Java GuiScreen.drawRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.gui.GuiScreen
的用法示例。
在下文中一共展示了GuiScreen.drawRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderLithiumControl
import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void renderLithiumControl(LCheckBox control, GuiScreen gui) {
//Get the outer most rectangle
Rectangle rect = getCheckBoxRect(control);
//Get the inside rectangle
Rectangle rect2 = getCheckBoxRect(control).inflate(-1, -1);
//Get the check rectangle
Rectangle rect3 = getCheckBoxRect(control).inflate(-3, -3);
//Draw outside rectangle
GuiScreen.drawRect(rect.getLeft(), rect.getTop(), rect.getRight(), rect.getBottom(), (int) control.getOutsideColor().getHexColor());
//Draw inside rect
GuiScreen.drawRect(rect2.getLeft(), rect2.getTop(), rect2.getRight(), rect2.getBottom(), (int) control.getInsideColor().getHexColor());
//Draw the string of the text
ModCoderPackUtils.getFontRenderer().drawString(control.getText(), rect2.getRight() + PADDING, rect2.getTop() + PADDING / 2, (int) control.getForeColor().getHexColor());
//If the checkbox is checked, render the check rectangle
if (control.isChecked()) {
GuiScreen.drawRect(rect3.getLeft(), rect3.getTop(), rect3.getRight(), rect3.getBottom(), (int) control.getCheckedColor().getHexColor());
}
}
示例2: drawHorizontalLine
import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
public void drawHorizontalLine ( GuiScreen gs, int p_73730_1_, int p_73730_2_, int p_73730_3_, int p_73730_4_ ) {
if ( p_73730_2_ < p_73730_1_ ) {
int i1 = p_73730_1_ ;
p_73730_1_ = p_73730_2_ ;
p_73730_2_ = i1 ;
}
gs . drawRect ( p_73730_1_, p_73730_3_, p_73730_2_ + 1, p_73730_3_ + 1, p_73730_4_ ) ;
}