Hi, first the method
[java] if (up){
waterValue = waterValue - 1;
foodValue = foodValue - 1;
if (foodValue == 1 && up)
{
}
if (waterValue == 1 && up)
{
}
foodString = String.valueOf(foodValue);
waterString = String.valueOf(waterValue);
/** Write text on the screen (HUD) */
//guiNode.detachAllChildren();
guiFont = assetManager.loadFont("Interface/Fonts/StatsNew.fnt");
BitmapText food = new BitmapText(guiFont, false);
food.setSize(guiFont.getCharSet().getRenderedSize());
food.setText(foodString + "%");
food.setColor(ColorRGBA.Green);
food.setLocalTranslation(90, settings.getHeight() - food.getLineHeight(), 0);
guiNode.attachChild(food);
BitmapText water = new BitmapText(guiFont, false);
water.setSize(guiFont.getCharSet().getRenderedSize());
water.setText(waterString + "%");
water.setColor(ColorRGBA.Blue);
water.setLocalTranslation(90, settings.getHeight() - water.getLineHeight() * 2, 0);
guiNode.attachChild(water);
// rootNode.attachChild(pivot);
}[/java]
I m not sure if anyone see it, i simply want that, if i press and/or hold âWâ (to run) the food and the water should go down and that shuld be written in the text ("water.setText(waterString + â%â); ) my posted method dont work really well but i cant think of a better one
ty for helping