Movable image renderer

This commit is contained in:
Frank 2022-08-16 22:30:08 +02:00
parent 49aa696e67
commit 82703fe992
2 changed files with 23 additions and 10 deletions

View file

@ -87,10 +87,19 @@ public class RenderHelper {
public static void renderImage(
PoseStack stack,
int width, int height,
int left, int top,
ResourceLocation location,
Rectangle uvRect,
Size resourceSize,
Size resourceSize, Rectangle uvRect,
float alpha
) {
renderImage(stack, left, top, uvRect.width, uvRect.height, location, resourceSize, uvRect, alpha);
}
public static void renderImage(
PoseStack stack,
int left, int top, int width, int height,
ResourceLocation location,
Size resourceSize, Rectangle uvRect,
float alpha
) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
@ -103,7 +112,7 @@ public class RenderHelper {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, alpha);
GuiComponent.blit(
stack,
0, 0, width, height,
left, top, width, height,
uvRect.left,
uvRect.top,
uvRect.width,