delete(this);
return;
}
+
vector screen_pos;
if (this.m_screen_coords) {
screen_pos = this.origin + since_hit * autocvar_cl_damagetext_2d_velocity;
vector world_pos = this.origin + world_offset.x * v_forward + world_offset.y * v_right + world_offset.z * v_up;
screen_pos = project_3d_to_2d(world_pos) + since_hit * autocvar_cl_damagetext_velocity_screen + autocvar_cl_damagetext_offset_screen;
}
+ screen_pos.y += size / 2;
+
if (screen_pos.z >= 0) {
screen_pos.z = 0;
vector rgb;
vector drawfontscale_save = drawfontscale;
drawfontscale = (size / autocvar_cl_damagetext_size_max) * '1 1 0';
+ screen_pos.y -= drawfontscale.x * size / 2;
drawcolorcodedstring2_builtin(screen_pos, this.text, autocvar_cl_damagetext_size_max * '1 1 0', rgb, alpha_, DRAWFLAG_NORMAL);
drawfontscale = drawfontscale_save;
}
seta cl_damagetext_alpha_lifetime "3" "Damage text lifetime in seconds"
seta cl_damagetext_velocity_screen "0 0 0" "Damage text move direction (screen coordinates)"
seta cl_damagetext_velocity_world "0 0 20" "Damage text move direction (world coordinates relative to player's view)"
-seta cl_damagetext_offset_screen "0 -40 0" "Damage text offset (screen coordinates)"
+seta cl_damagetext_offset_screen "0 -45 0" "Damage text offset (screen coordinates)"
seta cl_damagetext_offset_world "0 0 0" "Damage text offset (world coordinates relative to player's view)"
seta cl_damagetext_accumulate_range "30" "Damage text spawned within this range is accumulated"
seta cl_damagetext_accumulate_alpha_rel "0.65" "Only update existing damage text when it's above this much percentage (0 to 1) of the starting alpha"