use of gregtech.api.util.Position in project GregTech by GregTechCE.
the class ModularUI method updateScreenSize.
public void updateScreenSize(int screenWidth, int screenHeight) {
this.screenWidth = screenWidth;
this.screenHeight = screenHeight;
Position displayOffset = new Position(getGuiLeft(), getGuiTop());
guiWidgets.values().forEach(widget -> widget.setParentPosition(displayOffset));
}
use of gregtech.api.util.Position in project GregTech by GregTechCE.
the class Widget method isMouseOverElement.
public boolean isMouseOverElement(int mouseX, int mouseY) {
Position position = getPosition();
Size size = getSize();
return isMouseOver(position.x, position.y, size.width, size.height, mouseX, mouseY);
}
use of gregtech.api.util.Position in project GregTech by GregTechCE.
the class Widget method toRectangleBox.
public Rectangle toRectangleBox() {
Position pos = getPosition();
Size size = getSize();
return new Rectangle(pos.x, pos.y, size.width, size.height);
}
use of gregtech.api.util.Position in project GregTech by GregTechCE.
the class TextureArea method transformPos.
public static Position transformPos(Transformation transformation, Position position) {
Vector3 vector = new Vector3(position.x, position.y, 0.0);
transformation.apply(vector);
return new Position((int) vector.x, (int) vector.y);
}
use of gregtech.api.util.Position in project GregTech by GregTechCE.
the class AdvancedTextWidget method drawInBackground.
@Override
@SideOnly(Side.CLIENT)
public void drawInBackground(int mouseX, int mouseY, IRenderContext context) {
super.drawInBackground(mouseX, mouseY, context);
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
Position position = getPosition();
for (int i = 0; i < displayText.size(); i++) {
fontRenderer.drawString(displayText.get(i).getFormattedText(), position.x, position.y + i * (fontRenderer.FONT_HEIGHT + 2), color);
}
}
Aggregations