ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PagePicture.java

39 lines
1.4 KiB
Java
Raw Normal View History

2016-11-10 21:07:15 +01:00
/*
* This file ("PagePicture.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.booklet.page;
2016-11-12 00:29:01 +01:00
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.config.GuiUtils;
2016-11-10 21:07:15 +01:00
public class PagePicture extends BookletPage{
2016-11-12 00:29:01 +01:00
private final ResourceLocation resLoc;
private final int yTextOffset;
2016-11-10 21:07:15 +01:00
public PagePicture(int localizationKey, String pictureLocation, int yTextOffset){
super(localizationKey);
2016-11-12 00:29:01 +01:00
this.yTextOffset = yTextOffset;
this.resLoc = AssetUtil.getBookletGuiLocation(pictureLocation);
}
@Override
public void drawScreenPre(GuiBookletBase gui, int startX, int startY, int mouseX, int mouseY, float partialTicks){
super.drawScreenPre(gui, startX, startY, mouseX, mouseY, partialTicks);
gui.mc.getTextureManager().bindTexture(this.resLoc);
GuiUtils.drawTexturedModalRect(startX-6, startY-7, 0, 0, 256, 256, 0);
PageTextOnly.renderTextToPage(gui, this, startX+6, startY-7+this.yTextOffset);
2016-11-10 21:07:15 +01:00
}
}