Search in sources :

Example 6 with Vector4f

use of org.lwjgl.util.vector.Vector4f 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)

Example 7 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project j6dof-flight-sim by chris-ali.

the class LWJGLWorld method step.

/**
 * Main game loop of the LWJGL process, whose stepping is controlled by the {@link SimulationRunner} object's thread
 */
@Override
public void step() {
    try {
        ParticleMaster.update(camera);
        masterRenderer.renderWholeScene(entities, terrainCollection.getTerrainTree(), lights, camera, new Vector4f(0, 1, 0, 0));
        ParticleMaster.renderParticles(camera);
        interfaceRenderer.render(interfaceTextures);
        TextMaster.render(simTexts.getTexts());
        DisplayManager.updateDisplay();
    } catch (Exception e) {
        logger.error("Error encountered while running LWJGL display!", e);
    }
    if (Display.isCloseRequested()) {
        fireWindowClosed();
        cleanUp();
    }
}
Also used : Vector4f(org.lwjgl.util.vector.Vector4f)

Aggregations

Vector4f (org.lwjgl.util.vector.Vector4f)7 PanelButton (betterquesting.api2.client.gui.controls.PanelButton)4 CanvasTextured (betterquesting.api2.client.gui.panels.CanvasTextured)4 IPanelButton (betterquesting.api2.client.gui.controls.IPanelButton)3 CanvasEmpty (betterquesting.api2.client.gui.panels.CanvasEmpty)3 PanelVScrollBar (betterquesting.api2.client.gui.panels.bars.PanelVScrollBar)3 CanvasScrolling (betterquesting.api2.client.gui.panels.lists.CanvasScrolling)3 GuiPadding (betterquesting.api2.client.gui.misc.GuiPadding)2 GuiRectangle (betterquesting.api2.client.gui.misc.GuiRectangle)2 GuiTransform (betterquesting.api2.client.gui.misc.GuiTransform)2 PanelLine (betterquesting.api2.client.gui.panels.content.PanelLine)2 PanelTextBox (betterquesting.api2.client.gui.panels.content.PanelTextBox)2 IGuiTexture (betterquesting.api2.client.gui.resources.textures.IGuiTexture)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Matrix4f (org.lwjgl.util.vector.Matrix4f)2 Vector3f (org.lwjgl.util.vector.Vector3f)2 ITheme (betterquesting.api.client.themes.ITheme)1 BigItemStack (betterquesting.api.utils.BigItemStack)1 PanelButtonStorage (betterquesting.api2.client.gui.controls.PanelButtonStorage)1 IGuiRect (betterquesting.api2.client.gui.misc.IGuiRect)1