当前位置: 首页>>代码示例>>Java>>正文


Java Color.GREEN属性代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.Color.GREEN属性的典型用法代码示例。如果您正苦于以下问题:Java Color.GREEN属性的具体用法?Java Color.GREEN怎么用?Java Color.GREEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.badlogic.gdx.graphics.Color的用法示例。


在下文中一共展示了Color.GREEN属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HealthBar

public HealthBar(float x, float y, float healthLeft, float height, boolean showHUDElement) {
	super(x, y, showHUDElement);
	
	this.x = x;
	this.y = y;
	this.showHUDElement = showHUDElement;
	this.height = height;
	this.healthLeft = healthLeft;
	width = healthLeft;
	totalHealth = healthLeft;

	// Start Color
	healthBarColor = Color.GREEN;
	
	// Shape Renderer
	shapeRenderer = new ShapeRenderer();

}
 
开发者ID:ja-brouil,项目名称:StarshipFighters,代码行数:18,代码来源:HealthBar.java

示例2: draw

public void draw(SpriteBatch spriteBatch) {
	
	// Draw HUD Element if it needs to be drawn
	if (showHUDElement) {

		shapeRenderer.begin(ShapeType.Filled);
		// Change HP color to yellow between 20% and 10% and red at 10% and lower
		if (healthLeft >= (totalHealth * 0.4)) {
			healthBarColor = Color.GREEN;
		}
		else if (healthLeft < (totalHealth * 0.4) && healthLeft > (totalHealth * 0.2)) {
			healthBarColor = Color.YELLOW;
		} else if (healthLeft < (totalHealth * 0.2)) {
			healthBarColor = Color.RED;
		}
		shapeRenderer.setColor(healthBarColor);
		shapeRenderer.rect(x, y, healthLeft - 1, height);
		shapeRenderer.end();
		
		shapeRenderer.begin(ShapeType.Line);
		shapeRenderer.setColor(Color.WHITE);
		shapeRenderer.rect(x, y, width, height);
		shapeRenderer.end();
	}
	
}
 
开发者ID:ja-brouil,项目名称:StarshipFighters,代码行数:26,代码来源:HealthBar.java

示例3: detcolor

public Color detcolor(int c){
    switch (c){
        case 1:{
            return Color.RED;
        }
        case 2:{
            return Color.BLUE;
        }
        case 3:{
            return Color.GREEN;
        }
    }
    return Color.BLACK;
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:14,代码来源:ScreenChat.java

示例4: renderGender

/**
 * Zeigt den Geschlechtsauswahl Bildschirm an
 *
 * @param camera die aktuelle Kamera
 */
public void renderGender(OrthographicCamera camera)
{
    Color maleColor;
    Color femaleColor;

    if (stateSwitch)
    {
        maleColor = Color.GREEN;
        femaleColor = Color.DARK_GRAY;
    } else {
        maleColor = Color.DARK_GRAY;
        femaleColor = Color.GREEN;
    }

    fontLayout.setText(font, localeBundle.get("geschlecht"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, camera.viewportHeight / 2 - 120);

    fontLayout.setText(font, localeBundle.get("frau"), femaleColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, 30);

    fontLayout.setText(font, localeBundle.get("mann"), maleColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, -30);

    fontLayout.setText(smallFont, localeBundle.get("enter_bestaetigen"), Color.WHITE, camera.viewportWidth, Align.center, false);
    smallFont.draw(batch, fontLayout, -camera.viewportWidth / 2, -camera.viewportHeight / 2 + 70);
}
 
开发者ID:Entwicklerpages,项目名称:school-game,代码行数:31,代码来源:CreateGameSlot.java

示例5: renderTutorial

/**
 * Zeigt den Tutorial-Wahl Bildschirm an
 *
 * @param camera die aktuelle Kamera
 */
public void renderTutorial(OrthographicCamera camera)
{
    Color yesColor;
    Color noColor;

    if (stateSwitch)
    {
        yesColor = Color.GREEN;
        noColor = Color.DARK_GRAY;
    } else {
        yesColor = Color.DARK_GRAY;
        noColor = Color.GREEN;
    }

    fontLayout.setText(font, localeBundle.get("tutorial1"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, camera.viewportHeight / 2 - 120);
    fontLayout.setText(font, localeBundle.get("tutorial2"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, camera.viewportHeight / 2 - 185);

    fontLayout.setText(font, localeBundle.get("ja"), yesColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, 30);

    fontLayout.setText(font, localeBundle.get("nein"), noColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, -30);

    fontLayout.setText(smallFont, localeBundle.get("enter_bestaetigen"), Color.WHITE, camera.viewportWidth, Align.center, false);
    smallFont.draw(batch, fontLayout, -camera.viewportWidth / 2, -camera.viewportHeight / 2 + 70);
}
 
开发者ID:Entwicklerpages,项目名称:school-game,代码行数:33,代码来源:CreateGameSlot.java

示例6: HealLabel

public HealLabel(String message, GameObject source)
{
	super(message, source, Color.GREEN);
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:4,代码来源:HealLabel.java


注:本文中的com.badlogic.gdx.graphics.Color.GREEN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。