Search in sources :

Example 1 with GuiIconProvider

use of net.malisis.core.renderer.icon.provider.GuiIconProvider in project Almura by AlmuraDev.

the class UIAvatarImage method drawForeground.

@Override
public void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTicks) {
    if (this.playerInfo == null) {
        return;
    }
    final GuiTexture texture = new GuiTexture(this.playerInfo.getLocationSkin(), 64, 64);
    // Draw base face
    ((GuiIconProvider) this.iconProvider).setIcon(texture.createIcon(FACE_X_BASE, FACE_Y_BASE, FACE_WIDTH, FACE_HEIGHT));
    renderer.bindTexture(texture);
    renderer.drawShape(this.shape, this.rp);
    // Reset shape
    this.shape.resetState();
    this.shape.setSize(this.width, this.height);
    this.shape.setPosition(0, 0);
    // Draw overlay face
    ((GuiIconProvider) this.iconProvider).setIcon(texture.createIcon(FACE_X_OVERLAY, FACE_Y_OVERLAY, FACE_WIDTH, FACE_HEIGHT));
    renderer.drawShape(this.shape, this.rp);
}
Also used : GuiTexture(net.malisis.core.client.gui.GuiTexture) GuiIconProvider(net.malisis.core.renderer.icon.provider.GuiIconProvider)

Aggregations

GuiTexture (net.malisis.core.client.gui.GuiTexture)1 GuiIconProvider (net.malisis.core.renderer.icon.provider.GuiIconProvider)1