Search in sources :

Example 1 with URLTexture

use of gregtech.api.gui.resources.URLTexture in project GregTech by GregTechCEu.

the class ImageWidget method initFixed.

@Override
protected Widget initFixed() {
    width = Math.max(0, width);
    height = Math.max(0, height);
    this.setSize(new Size(width, height));
    switch(form) {
        case "url":
            image = new URLTexture(source);
            break;
        case "item":
            image = new ItemStackTexture(Item.getByNameOrId(source));
            break;
        case "resource":
            image = new TextureArea(new ResourceLocation(source), 0.0, 0.0, 1.0, 1.0);
            break;
    }
    return this;
}
Also used : URLTexture(gregtech.api.gui.resources.URLTexture) ItemStackTexture(gregtech.api.gui.resources.ItemStackTexture) Size(gregtech.api.util.Size) ResourceLocation(net.minecraft.util.ResourceLocation) TextureArea(gregtech.api.gui.resources.TextureArea)

Aggregations

ItemStackTexture (gregtech.api.gui.resources.ItemStackTexture)1 TextureArea (gregtech.api.gui.resources.TextureArea)1 URLTexture (gregtech.api.gui.resources.URLTexture)1 Size (gregtech.api.util.Size)1 ResourceLocation (net.minecraft.util.ResourceLocation)1