本文整理匯總了Java中com.badlogic.gdx.graphics.Color.RED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Color.RED屬性的具體用法?Java Color.RED怎麽用?Java Color.RED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.badlogic.gdx.graphics.Color
的用法示例。
在下文中一共展示了Color.RED屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
}
示例2: draw
public static void draw(SpriteBatch batch, float x, float y) {
component.setText("x " + GameScreenManager.getLocalPlayer().getLives());
if (GameScreenManager.getLocalPlayer().getLives() == 0) {
if (component.getParameter().color != Color.RED) {
component.getParameter().color = Color.RED;
component.update();
}
} else {
if (component.getParameter().color != Color.WHITE) {
component.getParameter().color = Color.WHITE;
component.update();
}
}
component.draw(batch, x + LIFE_ICON.getWidth(), y + component.getLayout().height * 3.5f);
LIFE_ICON.setPosition(x, y);
LIFE_ICON.draw(batch);
}
示例3: convertColor
private Color convertColor(CustomColor color) {
switch(color) {
case WHITE:
return Color.WHITE;
case BLACK:
return Color.BLACK;
case BLUE:
return Color.BLUE;
default:
return Color.RED;
}
}
示例4: convertColor
private Color convertColor(CustomColor color) {
switch (color) {
case WHITE:
return Color.WHITE;
case BLACK:
return Color.BLACK;
case BLUE:
return Color.BLUE;
default:
return Color.RED;
}
}
示例5: 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;
}
示例6: NormalDamageLabel
public NormalDamageLabel(int damage, GameObject source)
{
super(String.valueOf(damage), source, Color.RED);
x = source.getX() + 12;
y = source.getY() + 12;
}
示例7: TextParticle
public TextParticle(@NotNull String text) { this(text, Color.RED); }