Search in sources :

Example 1 with ListingCenteredElement

use of slimeknights.tconstruct.library.client.book.elements.ListingCenteredElement in project TinkersConstruct by SlimeKnights.

the class ContentListingCentered method build.

@Override
public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) {
    int yOff = 0;
    if (this.title != null) {
        this.addTitle(list, this.title, false);
        yOff = getTitleHeight();
    }
    int y = yOff;
    int x = 0;
    int w = BookScreen.PAGE_WIDTH;
    for (TextData data : this.entries) {
        int ex = x + w / 2 - book.fontRenderer.width(data.text) / 2;
        list.add(new ListingCenteredElement(ex, y, w, 9, data));
        y += 9;
    }
}
Also used : ListingCenteredElement(slimeknights.tconstruct.library.client.book.elements.ListingCenteredElement) TextData(slimeknights.mantle.client.book.data.element.TextData)

Aggregations

TextData (slimeknights.mantle.client.book.data.element.TextData)1 ListingCenteredElement (slimeknights.tconstruct.library.client.book.elements.ListingCenteredElement)1