|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 02:24:02
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 13 03:23:48 2011 +0100
Dance rank text 3d effects
---
game/dancegraph.cc | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ed34b53..54039aa 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -524,16 +524,19 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
}
// Draw a text telling how well we hit
+ double alpha = 1.0 - glow;
if (!mine && note.isHit) {
std::string text;
if (note.releaseTime <= 0.0 && tBeg < tEnd) { // Is being held down and is a hold note
text = "HOLD";
- glow = 1.0;
+ alpha = glow = 1.0;
} else if (glow > 0.0) { // Released already, display rank
text = note.score ? getRank(note.error) : "FAIL!";
}
if (!text.empty()) {
- double sc = getScale() * 1.2 * arrowSize * (1.0 + glow);
+ double sc = getScale() * 0.6 * arrowSize * (3.0 + glow);
+ Transform trans(glmath::translate(glmath::vec3(0.0, 0.0, 0.5 * glow))); // Slightly elevated
+ ColorTrans c(Color(1.0, 1.0, 1.0, std::sqrt(alpha)));
m_popupText->render(text);
m_popupText->dimensions().middle(x).center(time2y(0.0)).stretch(sc, sc/2.0);
m_popupText->draw();
|