com.github.vini2003.blade.client.utilities.Scissors.destroy()

Here are the examples of the java api com.github.vini2003.blade.client.utilities.Scissors.destroy() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

12 Source : HorizontalArrowWidget.java
with MIT License
from Mixinors

@Environment(EnvType.CLIENT)
@Override
public void drawWidget(MatrixStack matrices, VertexConsumerProvider provider) {
    if (getHidden()) {
        return;
    }
    float x = getPosition().getX();
    float y = getPosition().getY();
    float sX = getSize().getWidth();
    float sY = getSize().getHeight();
    float rawHeight = MinecraftClient.getInstance().getWindow().getHeight();
    float scale = (float) MinecraftClient.getInstance().getWindow().getScaleFactor();
    float sBGX = (int) (((sX / getLimit()) * getProgress()));
    RenderLayer backgroundLayer = Layers.get(getBackgroundTexture());
    RenderLayer foregroundLayer = Layers.get(getForegroundTexture());
    Scissors area = new Scissors(provider, (int) (x * scale), (int) (rawHeight - ((y + sY) * scale)), (int) (sX * scale), (int) (sY * scale));
    BaseRenderer.drawTexturedQuad(matrices, provider, backgroundLayer, getPosition().getX(), getPosition().getY(), getSize().getWidth(), getSize().getHeight(), getBackgroundTexture());
    area.destroy(provider);
    area = new Scissors(provider, (int) (x * scale), (int) (rawHeight - ((y + sY) * scale)), (int) (sBGX * scale), (int) (sY * scale));
    BaseRenderer.drawTexturedQuad(matrices, provider, foregroundLayer, getPosition().getX(), getPosition().getY(), getSize().getWidth(), getSize().getHeight(), getForegroundTexture());
    area.destroy(provider);
}

10 Source : EnergyVerticalBarWidget.java
with MIT License
from Mixinors

@Environment(EnvType.CLIENT)
@Override
public void drawWidget(@NotNull MatrixStack matrices, @NotNull VertexConsumerProvider provider) {
    if (getHidden())
        return;
    float x = getPosition().getX();
    float y = getPosition().getY();
    float sX = getSize().getWidth();
    float sY = getSize().getHeight();
    float rawHeight = Instances.client().getWindow().getHeight();
    float scale = (float) Instances.client().getWindow().getScaleFactor();
    EnergyVolume volume = volumeSupplier.get();
    float sBGY = (float) (sY / volume.getSize() * volume.getAmount());
    Scissors area = new Scissors(provider, (int) (x * scale), (int) (rawHeight - (y + sY) * scale), (int) (sX * scale), (int) (sY * scale));
    BaseRenderer.drawTexturedQuad(matrices, provider, Layers.get(ENERGY_BACKGROUND), x, y, sX, sY, ENERGY_BACKGROUND);
    area.destroy(provider);
    area = new Scissors(provider, (int) (x * scale), (int) (rawHeight - (y + sY) * scale), (int) (sX * scale), (int) (sBGY * scale));
    BaseRenderer.drawTexturedQuad(matrices, provider, Layers.get(ENERGY_FOREGROUND), x, y, sX, sY, ENERGY_FOREGROUND);
    area.destroy(provider);
}