use of hellfirepvp.astralsorcery.client.util.draw.BufferContext in project AstralSorcery by HellFirePvP.
the class ScreenJournalPerkTree method drawSearchHalo.
private void drawSearchHalo(BatchPerkContext ctx, MatrixStack renderStack, float size, float x, float y) {
BufferContext batch = ctx.getContext(searchContext);
SpriteSheetResource searchMark = SpritesAS.SPR_PERK_SEARCH;
searchMark.bindTexture();
Vector3 starVec = new Vector3(x - size, y - size, 0);
float uLength = searchMark.getUWidth();
float vLength = searchMark.getVWidth();
Tuple<Float, Float> frameUV = searchMark.getUVOffset();
Matrix4f offset = renderStack.getLast().getMatrix();
for (int i = 0; i < 4; i++) {
int u = ((i + 1) & 2) >> 1;
int v = ((i + 2) & 2) >> 1;
Vector3 pos = starVec.clone().addX(size * u * 2).addY(size * v * 2);
pos.drawPos(offset, batch).color(0.8F, 0.1F, 0.1F, 1F).tex(frameUV.getA() + uLength * u, frameUV.getB() + vLength * v).endVertex();
}
}
use of hellfirepvp.astralsorcery.client.util.draw.BufferContext in project AstralSorcery by HellFirePvP.
the class BatchPerkContext method draw.
public void draw() {
for (TextureObjectGroup group : bufferGroups.keySet()) {
BufferContext batch = bufferGroups.get(group);
group.getResource().bindTexture();
batch.draw();
}
}
use of hellfirepvp.astralsorcery.client.util.draw.BufferContext in project AstralSorcery by HellFirePvP.
the class PerkTreeConstellation method renderPerkAtBatch.
@Nullable
@Override
@OnlyIn(Dist.CLIENT)
public Rectangle.Float renderPerkAtBatch(BatchPerkContext drawCtx, MatrixStack renderStack, AllocationStatus status, long spriteOffsetTick, float pTicks, float x, float y, float zLevel, float scale) {
SpriteSheetResource tex = status.getPerkTreeHaloSprite();
BatchPerkContext.TextureObjectGroup grp = PerkPointHaloRenderGroup.INSTANCE.getGroup(tex);
if (grp == null) {
return new Rectangle.Float();
}
BufferContext buf = drawCtx.getContext(grp);
float haloSize = perkSpriteSize * scale;
if (status.isAllocated()) {
haloSize *= 1.3F;
}
Tuple<Float, Float> frameUV = tex.getUVOffset(spriteOffsetTick);
RenderingGuiUtils.rect(buf, renderStack, x - haloSize, y - haloSize, zLevel, haloSize * 2F, haloSize * 2F).color(1F, 1F, 1F, 0.85F).tex(frameUV.getA(), frameUV.getB(), tex.getULength(), tex.getVLength()).draw();
super.renderPerkAtBatch(drawCtx, renderStack, status, spriteOffsetTick, pTicks, x, y, zLevel, scale);
float actualSize = perkSpriteSize * scale;
return new Rectangle.Float(-actualSize, -actualSize, actualSize * 2, actualSize * 2);
}
use of hellfirepvp.astralsorcery.client.util.draw.BufferContext in project AstralSorcery by HellFirePvP.
the class PerkTreeGem method renderPerkAtBatch.
@Nullable
@Override
@OnlyIn(Dist.CLIENT)
public Rectangle.Float renderPerkAtBatch(BatchPerkContext drawCtx, MatrixStack renderStack, AllocationStatus status, long spriteOffsetTick, float pTicks, float x, float y, float zLevel, float scale) {
SpriteSheetResource tex = status.getPerkTreeHaloSprite();
BatchPerkContext.TextureObjectGroup grp = PerkPointHaloRenderGroup.INSTANCE.getGroup(tex);
if (grp == null) {
return new Rectangle.Float();
}
BufferContext buf = drawCtx.getContext(grp);
float haloSize = getRenderSize() * 0.8F * scale;
if (status.isAllocated()) {
haloSize *= 1.5;
}
Tuple<Float, Float> frameUV = tex.getUVOffset(spriteOffsetTick);
RenderingGuiUtils.rect(buf, renderStack, x - haloSize, y - haloSize, zLevel, haloSize * 2F, haloSize * 2F).color(1F, 1F, 1F, 0.85F).tex(frameUV.getA(), frameUV.getB(), tex.getULength(), tex.getVLength()).draw();
super.renderPerkAtBatch(drawCtx, renderStack, status, spriteOffsetTick, pTicks, x, y, zLevel, scale);
float actualSize = getRenderSize() * scale;
return new Rectangle.Float(-actualSize, -actualSize, actualSize * 2, actualSize * 2);
}
use of hellfirepvp.astralsorcery.client.util.draw.BufferContext in project AstralSorcery by HellFirePvP.
the class ScreenJournalPerkTree method drawSeal.
private void drawSeal(BatchPerkContext ctx, MatrixStack renderStack, double size, double x, double y, long spriteOffsetTick) {
BufferContext batch = ctx.getContext(sealContext);
drawSeal(batch, renderStack, size, x, y, spriteOffsetTick, 1F);
}
Aggregations