Search in sources :

Example 1 with PanelPlayerPortrait

use of betterquesting.api2.client.gui.panels.content.PanelPlayerPortrait in project BetterQuesting by Funwayguy.

the class GuiScreenTest method initPanel.

@Override
public void initPanel() {
    super.initPanel();
    IGuiRect ctt = new GuiTransform(new Vector4f(0.05F, 0.05F, 0.95F, 0.95F), new GuiPadding(0, 0, 0, 0), 0);
    CanvasTextured cvt1 = new CanvasTextured(ctt, PresetTexture.PANEL_MAIN.getTexture());
    this.addPanel(cvt1);
    CanvasScrolling cs1 = new CanvasScrolling(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(0, 0, 12, 0), 0)).setupAdvanceScroll(true, true, 0);
    cvt1.addPanel(cs1);
    PanelVScrollBar pvs = new PanelVScrollBar(new GuiTransform(GuiAlign.RIGHT_EDGE, new GuiPadding(-12, 4, 4, 4), 0));
    cvt1.addPanel(pvs);
    cs1.setScrollDriverY(pvs);
    CanvasTextured cvt2 = new CanvasTextured(new GuiRectangle(0, 0, 800, 500, 0), PresetTexture.PANEL_INNER.getTexture());
    cs1.addPanel(cvt2);
    PanelButton btn3 = new PanelButton(new GuiRectangle(-100, -20, 100, 20, 0), 1, "Button 3");
    cs1.addPanel(btn3);
    IGuiRect btt1 = new GuiTransform(GuiAlign.BOTTOM_CENTER, new GuiPadding(-100, -16, 0, 0), -1);
    IGuiRect btt2 = new GuiTransform(GuiAlign.BOTTOM_CENTER, new GuiPadding(0, -16, -100, 0), -1);
    PanelButton btn1 = new PanelButton(btt1, 0, "Button 1");
    PanelButton btn2 = new PanelButton(btt2, 1, "Button 2");
    cvt1.addPanel(btn1);
    cvt1.addPanel(btn2);
    try {
        IGuiRect pt1 = new GuiRectangle(0, 0, 64, 64, 0);
        IGuiRect pt2 = new GuiRectangle(64, 0, 48, 48, 0);
        IGuiRect pt3 = new GuiRectangle(112, 0, 32, 32, 0);
        PanelPlayerPortrait pp1 = new PanelPlayerPortrait(pt1, UUID.fromString("10755ea6-9721-467a-8b5c-92adf689072c"), "Darkosto");
        PanelPlayerPortrait pp2 = new PanelPlayerPortrait(pt2, UUID.fromString("ef35a72a-ef00-4c2a-a2a9-58a54a7bb9fd"), "GreatOrator");
        PanelPlayerPortrait pp3 = new PanelPlayerPortrait(pt3, UUID.fromString("4412cc00-65de-43ff-b19a-10e0ec64cc4a"), "Funwayguy");
        cs1.addPanel(pp1);
        cs1.addPanel(pp2);
        cs1.addPanel(pp3);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : IGuiRect(betterquesting.api2.client.gui.misc.IGuiRect) PanelPlayerPortrait(betterquesting.api2.client.gui.panels.content.PanelPlayerPortrait) Vector4f(org.lwjgl.util.vector.Vector4f) PanelButton(betterquesting.api2.client.gui.controls.PanelButton) GuiRectangle(betterquesting.api2.client.gui.misc.GuiRectangle) CanvasTextured(betterquesting.api2.client.gui.panels.CanvasTextured) CanvasScrolling(betterquesting.api2.client.gui.panels.lists.CanvasScrolling) PanelVScrollBar(betterquesting.api2.client.gui.panels.bars.PanelVScrollBar) GuiTransform(betterquesting.api2.client.gui.misc.GuiTransform) GuiPadding(betterquesting.api2.client.gui.misc.GuiPadding)

Aggregations

PanelButton (betterquesting.api2.client.gui.controls.PanelButton)1 GuiPadding (betterquesting.api2.client.gui.misc.GuiPadding)1 GuiRectangle (betterquesting.api2.client.gui.misc.GuiRectangle)1 GuiTransform (betterquesting.api2.client.gui.misc.GuiTransform)1 IGuiRect (betterquesting.api2.client.gui.misc.IGuiRect)1 CanvasTextured (betterquesting.api2.client.gui.panels.CanvasTextured)1 PanelVScrollBar (betterquesting.api2.client.gui.panels.bars.PanelVScrollBar)1 PanelPlayerPortrait (betterquesting.api2.client.gui.panels.content.PanelPlayerPortrait)1 CanvasScrolling (betterquesting.api2.client.gui.panels.lists.CanvasScrolling)1 Vector4f (org.lwjgl.util.vector.Vector4f)1