当前位置: 首页>>代码示例>>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;未经允许,请勿转载。