當前位置: 首頁>>代碼示例>>Java>>正文


Java GuiCelestialSelection類代碼示例

本文整理匯總了Java中micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection的典型用法代碼示例。如果您正苦於以下問題:Java GuiCelestialSelection類的具體用法?Java GuiCelestialSelection怎麽用?Java GuiCelestialSelection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GuiCelestialSelection類屬於micdoodle8.mods.galacticraft.core.client.gui.screen包,在下文中一共展示了GuiCelestialSelection類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawMothershipGuiParts

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawMothershipGuiParts(int mousePosX, int mousePosY)
{
    //int offset=0;
    //String str;

    GL11.glColor4f(0.0F, 0.6F, 1.0F, 1);
    //this.mc.renderEngine.bindTexture(GuiCelestialSelection.guiMain1);
    //this.mc.renderEngine.bindTexture(guiExtra);
    /*int canCreateLength = Math.max(0, this.drawSplitString(GCCoreUtil.translate("gui.message.canCreateMothership.name"), 0, 0, 91, 0, true, true) - 2);
    int canCreateOffset = canCreateLength * this.smallFontRenderer.FONT_HEIGHT;*/

    offsetX = width - GuiCelestialSelection.BORDER_WIDTH - GuiCelestialSelection.BORDER_EDGE_WIDTH;
    offsetY = GuiCelestialSelection.BORDER_WIDTH + GuiCelestialSelection.BORDER_EDGE_WIDTH;

    if(this.curMothership.isInTransit()) {
        drawTransitInfo(mousePosX, mousePosY);
    }
    if(this.hasMothershipStats) {
        drawMothershipInfo();
    }
    if(this.selectedBody != null) {
        drawTargetBodyInfo(mousePosX, mousePosY);
    }
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:25,代碼來源:GuiMothershipSelection.java

示例2: drawTransitBar

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawTransitBar(int length)
{
    // max length = 124
    this.drawTexturedModalRect(
            width/2-90+27,
            height-11-GuiCelestialSelection.BORDER_WIDTH+2,
            1, //displayed w
            4,  //displayed h
            0,    // u aka x in tex
            0,      // v
            1,     // w in texture
            4,      // h in texture
            false, false);
    // bar
    this.drawTexturedModalRect(
            width/2-90+28,
            height-11-GuiCelestialSelection.BORDER_WIDTH+2,
            length, //displayed w
            4,  //displayed h
            1,    // u aka x in tex
            0,      // v
            43,     // w in texture
            4,      // h in texture
            false, false);
    // right cap
    this.drawTexturedModalRect(
            width/2-90+28+length,
            height-11-GuiCelestialSelection.BORDER_WIDTH+2,
            1, //displayed w
            4,  //displayed h
            56,    // u aka x in tex
            0,      // v
            1,     // w in texture
            4,      // h in texture
            false, false);
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:37,代碼來源:GuiMothershipSelection.java

示例3: drawItemForFuel

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawItemForFuel(int x, int y, ItemStack item) {
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glPushMatrix();
    float factor = 0.5F;
    GL11.glScalef(factor, factor, factor);
    GuiCelestialSelection.itemRender.renderItemAndEffectIntoGUI(
            this.fontRendererObj,
            this.mc.renderEngine,
            item, (int)(x/factor), (int)(y/factor));
    RenderHelper.disableStandardItemLighting();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:14,代碼來源:GuiMothershipSelection.java

示例4: drawButtons

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
@Override
public void drawButtons(int mousePosX, int mousePosY)
{
    this.possibleBodies = this.shuttlePossibleBodies;
    super.drawButtons(mousePosX, mousePosY);
    if (this.selectionState != EnumSelectionState.PROFILE && this.selectedBody != null && canCreateMothership(this.selectedBody))
    {
        drawMothershipButton(mousePosX, mousePosY);
    }

    // exit button

    GL11.glColor4f(0.0F, 1.0F, 0.1F, 1);
    this.mc.renderEngine.bindTexture(GuiCelestialSelection.guiMain0);


    int exitWidth = width - GuiCelestialSelection.BORDER_WIDTH - GuiCelestialSelection.BORDER_EDGE_WIDTH - 74;
    int exitHeight = height - GuiCelestialSelection.BORDER_WIDTH - GuiCelestialSelection.BORDER_EDGE_WIDTH - 11;

    exitBtnArea.setPositionSize(exitWidth, exitHeight, 74, 11);

    this.drawTexturedModalRect(
            exitBtnArea.minX,
            exitBtnArea.minY,
            exitBtnArea.getWidth(),
            exitBtnArea.getHeight(),
            0, 392, 148, 22, true, true);
    String str = GCCoreUtil.translate("gui.message.cancel.name").toUpperCase();
    this.fontRendererObj.drawString(str,
            exitBtnArea.minX + (exitBtnArea.getWidth()-this.fontRendererObj.getStringWidth(str))/2,
            exitBtnArea.minY + 2, ColorUtil.to32BitColor(255, 255, 255, 255));
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:33,代碼來源:GuiShuttleSelection.java

示例5: drawItemForRecipe

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawItemForRecipe(ItemStack item, int amount, int requiredAmount, int xPos, int yPos, int mousePosX, int mousePosY)
{
    RenderHelper.enableGUIStandardItemLighting();
    GuiCelestialSelection.itemRender.renderItemAndEffectIntoGUI(
            this.fontRendererObj,
            this.mc.renderEngine,
            item, xPos, yPos);
    RenderHelper.disableStandardItemLighting();
    GL11.glEnable(GL11.GL_BLEND);

    if(isMouseWithin(mousePosX, mousePosY, xPos, yPos, 16, 16))
    {
        this.showTooltip(item.getDisplayName(), mousePosX, mousePosY);
    }

    String str = "" + amount + "/" + requiredAmount;
    boolean valid = amount >= requiredAmount;

    int color = valid | this.mc.thePlayer.capabilities.isCreativeMode ? ColorUtil.to32BitColor(255, 0, 255, 0) : ColorUtil.to32BitColor(255, 255, 0, 0);
    this.smallFontRenderer.drawString(
            str,
            xPos + 8 - this.smallFontRenderer.getStringWidth(str) / 2,
            //offset + GuiCelestialSelection.BORDER_WIDTH + GuiCelestialSelection.BORDER_EDGE_WIDTH + 154 + canCreateOffset
            yPos+16, color);


    /* posY = c+154;
     * drawStr=c+170
     * c = posY-154
     * drawStr = posY-154+170
     * drawStr = posY+16
     */

}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:35,代碼來源:GuiShuttleSelection.java

示例6: onRingRender

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRingRender(CelestialBodyRenderEvent.CelestialRingRenderEvent.Pre renderEvent)
{
    if (renderEvent.celestialBody.equals(AsteroidsModule.planetAsteroids))
    {
    	if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiCelestialSelection)
    		GL11.glColor4f(0.7F, 0.0F, 0.0F, 0.5F);
    	else
    		GL11.glColor4f(0.3F, 0.1F, 0.1F, 1.0F);
        renderEvent.setCanceled(true);
        GL11.glBegin(GL11.GL_LINE_LOOP);

        final float theta = (float) (2 * Math.PI / 90);
        final float cos = (float) Math.cos(theta);
        final float sin = (float) Math.sin(theta);

        float min = 72.0F;
        float max = 78.0F;

        float x = max * renderEvent.celestialBody.getRelativeDistanceFromCenter().unScaledDistance;
        float y = 0;

        float temp;
        for (int i = 0; i < 90; i++)
        {
            GL11.glVertex2f(x, y);

            temp = x;
            x = cos * x - sin * y;
            y = sin * temp + cos * y;
        }

        GL11.glEnd();
        GL11.glBegin(GL11.GL_LINE_LOOP);

        x = min * renderEvent.celestialBody.getRelativeDistanceFromCenter().unScaledDistance;
        y = 0;

        for (int i = 0; i < 90; i++)
        {
            GL11.glVertex2f(x, y);

            temp = x;
            x = cos * x - sin * y;
            y = sin * temp + cos * y;
        }

        GL11.glEnd();
        GL11.glColor4f(0.7F, 0.0F, 0.0F, 0.1F);
        GL11.glBegin(GL11.GL_QUADS);

        x = min * renderEvent.celestialBody.getRelativeDistanceFromCenter().unScaledDistance;
        y = 0;
        float x2 = max * renderEvent.celestialBody.getRelativeDistanceFromCenter().unScaledDistance;
        float y2 = 0;

        for (int i = 0; i < 90; i++)
        {
            GL11.glVertex2f(x2, y2);
            GL11.glVertex2f(x, y);

            temp = x;
            x = cos * x - sin * y;
            y = sin * temp + cos * y;
            temp = x2;
            x2 = cos * x2 - sin * y2;
            y2 = sin * temp + cos * y2;

            GL11.glVertex2f(x, y);
            GL11.glVertex2f(x2, y2);
        }

        GL11.glEnd();
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:77,代碼來源:AsteroidsEventHandlerClient.java

示例7: drawTransitInfo

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawTransitInfo(int mousePosX, int mousePosY)
{
    GL11.glColor4f(0.0F, 0.6F, 1.0F, 1);
    this.mc.renderEngine.bindTexture(guiExtra);


    this.drawTexturedModalRect(
            width/2-90,
            height-11-GuiCelestialSelection.BORDER_WIDTH-4,
            TRANSIT_INFO_W, //w
            TRANSIT_INFO_H,  //h
            TRANSIT_INFO_U,    // u
            TRANSIT_INFO_V,      // v
            TRANSIT_INFO_W,
            TRANSIT_INFO_H,
            false, false);

 // bar
    //this.mc.renderEngine.bindTexture(GuiCelestialSelection.guiMain0);

    GL11.glColor4f(0.35F, 0.01F, 0.01F, 1);
    //GL11.glEnable(GL11.GL_BLEND);

    drawTransitBar(124);

    GL11.glColor4f(0.95F, 0.01F, 0.01F, 1);
    drawTransitBar(this.curMothership.getScaledTravelTime(124));

    /*this.drawTexturedModalRect(
            width/2-90+28,
            height-11-GuiCelestialSelection.BORDER_WIDTH+2,
            length, //displayed w
            4,  //displayed h
            1,    // u aka x in tex
            0,      // v
            43,     // w in texture
            4,      // h in texture
            false, false);*/
    if(isMouseWithin(mousePosX, mousePosY, width/2-90+28, height-11-GuiCelestialSelection.BORDER_WIDTH+2, 124, 4)) {
        //GCCoreUtil.translate("gui.message.mothership.travelTimeRemain")
        // ;
        this.showTooltip(GCCoreUtil.translateWithFormat("gui.message.mothership.travelTimeRemain", GuiHelper.formatTime(curMothership.getRemainingTravelTime())), mousePosX, mousePosY);
    }


    // test place planet symbols
    // source
    int bodyX = width/2-90+14;
    int bodyY = height-11-GuiCelestialSelection.BORDER_WIDTH;
    this.drawBodyOnGUI(curMothership.getSource(), bodyX, bodyY, 8, 8);
    if(isMouseWithin(mousePosX, mousePosY, bodyX, bodyY, 8, 8)) {
        this.showTooltip(curMothership.getSource().getLocalizedName(), mousePosX, mousePosY);
    }
    // dest
    bodyX = width/2+90-14-8;
    bodyY = height-11-GuiCelestialSelection.BORDER_WIDTH;
    this.drawBodyOnGUI(curMothership.getDestination(), bodyX, bodyY, 8, 8);
    if(isMouseWithin(mousePosX, mousePosY, bodyX, bodyY, 8, 8)) {
        this.showTooltip(curMothership.getDestination().getLocalizedName(), mousePosX, mousePosY);
    }
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:62,代碼來源:GuiMothershipSelection.java

示例8: drawIcon

import micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection; //導入依賴的package包/類
protected void drawIcon(int x, int y, MothershipFuelDisplay fuelType) {


        ResourceLocation resourcelocation = this.mc.renderEngine.getResourceLocation(fuelType.getSpriteNumber());// 0 is correct
        this.mc.renderEngine.bindTexture(resourcelocation);

        GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up.
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glEnable(GL11.GL_BLEND);

        GuiCelestialSelection.itemRender.renderIcon(x, y, fuelType.getIcon(), 8, 8);

    }
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:14,代碼來源:GuiMothershipSelection.java


注:本文中的micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。