diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp
index a1dfa0b61..47a2b6534 100644
--- a/Source/Engine/Debug/DebugDraw.cpp
+++ b/Source/Engine/Debug/DebugDraw.cpp
@@ -454,7 +454,12 @@ inline void DrawText3D(const DebugText3D& t, const RenderContext& renderContext,
{
Matrix w, fw, m;
if (t.FaceCamera)
- Matrix::CreateWorld(t.Transform.Translation, renderContext.View.Direction, viewUp, w);
+ {
+ Matrix s, ss;
+ Matrix::Scaling(t.Transform.Scale.X, s);
+ Matrix::CreateWorld(t.Transform.Translation, renderContext.View.Direction, viewUp, ss);
+ Matrix::Multiply(s, ss, w);
+ }
else
t.Transform.GetWorld(w);
Matrix::Multiply(f, w, fw);
@@ -1993,7 +1998,7 @@ void DebugDraw::DrawText(const StringView& text, const Float2& position, const C
t.TimeLeft = duration;
}
-void DebugDraw::DrawText(const StringView& text, const Vector3& position, const Color& color, int32 size, float duration)
+void DebugDraw::DrawText(const StringView& text, const Vector3& position, const Color& color, int32 size, float duration, float scale)
{
if (text.Length() == 0 || size < 4)
return;
@@ -2003,6 +2008,7 @@ void DebugDraw::DrawText(const StringView& text, const Vector3& position, const
Platform::MemoryCopy(t.Text.Get(), text.Get(), text.Length() * sizeof(Char));
t.Text[text.Length()] = 0;
t.Transform = position - Context->Origin;
+ t.Transform.Scale.X = scale;
t.FaceCamera = true;
t.Size = size;
t.Color = color;
diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h
index b37080d0f..8cc5452ed 100644
--- a/Source/Engine/Debug/DebugDraw.h
+++ b/Source/Engine/Debug/DebugDraw.h
@@ -590,7 +590,8 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
/// The color.
/// The font size.
/// The duration (in seconds). Use 0 to draw it only once.
- API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, const Color& color, int32 size = 32, float duration = 0.0f);
+ /// The text scale.
+ API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, const Color& color, int32 size = 32, float duration = 0.0f, float scale = 1.0f);
///
/// Draws the text (3D).