本文整理匯總了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_ ) ;
}