From: Samual Date: Sun, 16 Oct 2011 06:03:44 +0000 (-0400) Subject: Re-arrange and add some comments X-Git-Tag: xonotic-v0.6.0~35^2~78^2~7^2~49 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a41df9818462021385aa8cf01dff05018ab013e;p=xonotic%2Fxonotic-data.pk3dir.git Re-arrange and add some comments --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index cdfce5f48..459af161a 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4671,6 +4671,8 @@ void HUD_CenterPrint (void) else continue; } + + // fade the centerprint in/out if (centerprint_time[j] < 0 || centerprint_expire_time[j] - centerprint_fadetime > time) { a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / centerprint_fadetime, 1); @@ -4680,14 +4682,14 @@ void HUD_CenterPrint (void) a = (centerprint_expire_time[j] - time) / centerprint_fadetime; } + // also fade it based on positioning a = a * bound(0.5, (1 - (i / 2)), 1); // pass one: all messages after the first have half alpha a = a * bound(0.5, (1 - (i / 10)), 1); // pass two: after that, gradually lower alpha even more for each message - sz = 0.75 + a * (1 - 0.75); // set the sizing based on alpha - - //print(strcat("alpha for centerprint ", ftos(i), ": ", ftos(a), ".\n")); - + // finally set the size based on the new alpha + sz = 0.75 + a * (1 - 0.75); drawfontscale = sz * '1 1 0'; + if (centerprint_countdown_num[j]) n = tokenizebyseparator(sprintf(centerprint_messages[j], centerprint_countdown_num[j]), "\n"); else