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

42 lines
1.4 KiB
Java
Raw Normal View History

2016-11-10 21:07:15 +01:00
/*
* This file ("PageTextOnly.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-10 22:06:58 +01:00
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
2016-11-10 21:07:15 +01:00
public class PageTextOnly extends BookletPage{
2016-11-22 22:54:35 +01:00
public PageTextOnly(int localizationKey, int priority){
super(localizationKey, priority);
}
2016-11-10 21:07:15 +01:00
public PageTextOnly(int localizationKey){
super(localizationKey);
}
2016-11-10 22:06:58 +01:00
2016-11-11 16:37:45 +01:00
@SideOnly(Side.CLIENT)
public static void renderTextToPage(GuiBookletBase gui, BookletPage page, int x, int y){
String text = page.getInfoText();
2016-11-10 22:06:58 +01:00
if(text != null && !text.isEmpty()){
2016-11-11 16:37:45 +01:00
gui.renderSplitScaledAsciiString(text, x, y, 0, false, 0.75F, 120);
2016-11-10 22:06:58 +01:00
}
}
@Override
@SideOnly(Side.CLIENT)
public void drawScreenPre(GuiBookletBase gui, int startX, int startY, int mouseX, int mouseY, float partialTicks){
super.drawScreenPre(gui, startX, startY, mouseX, mouseY, partialTicks);
renderTextToPage(gui, this, startX+6, startY+5);
}
2016-11-10 21:07:15 +01:00
}