Search in sources :

Example 16 with IPoint

use of binnie.core.api.gui.IPoint in project Binnie by ForestryMC.

the class TextureRenderer method texture.

public void texture(@Nullable final ITexture texture, final IPoint position) {
    if (texture == null) {
        return;
    }
    this.setTexture(texture);
    final IPoint point = position.sub(texture.getBorder().getLeft(), texture.getBorder().getTop());
    final IArea textureArea = texture.getArea().outset(texture.getBorder());
    GuiUtils.drawTexturedModalRect(point.xPos(), point.yPos(), textureArea.pos().xPos(), textureArea.pos().yPos(), textureArea.size().xPos(), textureArea.size().yPos(), 0);
}
Also used : IArea(binnie.core.api.gui.IArea) IPoint(binnie.core.api.gui.IPoint)

Example 17 with IPoint

use of binnie.core.api.gui.IPoint in project Binnie by ForestryMC.

the class GuiCraftGUI method resize.

public void resize(final IPoint size) {
    this.xSize = size.xPos();
    this.ySize = size.yPos();
    this.guiLeft = (this.width - this.xSize) / 2;
    this.guiTop = (this.height - this.ySize) / 2;
    this.window.setPosition(new Point(this.guiLeft, this.guiTop));
}
Also used : IPoint(binnie.core.api.gui.IPoint) Point(binnie.core.gui.geometry.Point)

Aggregations

IPoint (binnie.core.api.gui.IPoint)17 Point (binnie.core.gui.geometry.Point)10 IArea (binnie.core.api.gui.IArea)5 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)5 Area (binnie.core.gui.geometry.Area)4 EventWidget (binnie.core.gui.events.EventWidget)3 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)3 IWidget (binnie.core.api.gui.IWidget)2 ItemStack (net.minecraft.item.ItemStack)2 Fluid (net.minecraftforge.fluids.Fluid)2 IFieldKitPlugin (binnie.core.api.genetics.IFieldKitPlugin)1 ControlText (binnie.core.gui.controls.ControlText)1 WindowAbstractDatabase (binnie.core.gui.database.WindowAbstractDatabase)1 GuiCraftGUI (binnie.core.gui.minecraft.GuiCraftGUI)1 ControlItemDisplay (binnie.core.gui.minecraft.control.ControlItemDisplay)1 FenceType (binnie.extratrees.blocks.decor.FenceType)1 IPlankType (binnie.extratrees.wood.planks.IPlankType)1 IChromosomeType (forestry.api.genetics.IChromosomeType)1 Map (java.util.Map)1 Block (net.minecraft.block.Block)1