HealthHUD redesigned

This commit is contained in:
viktorljung
2016-02-12 01:57:53 +01:00
parent 0370775820
commit fb5164221f
6 changed files with 208 additions and 32 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ void HealthHUDSystem::Update(double dt)
s = s + "/";
s = s + std::to_string((int)(double)entityIDParent["Health"]["MaxHealth"]);
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Fill"]["Color"]).a);
(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Text"]["Color"]).a);
entity["Text"]["Content"] = s;
}