diff --git a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
index a678e868a..5bb33ef63 100644
--- a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
+++ b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
@@ -2,6 +2,7 @@
using System;
using FlaxEditor.GUI.ContextMenu;
+using FlaxEditor.GUI.Input;
using FlaxEngine;
using Object = FlaxEngine.Object;
@@ -14,7 +15,7 @@ namespace FlaxEditor.Viewport.Previews
public class AnimatedModelPreview : AssetPreview
{
private AnimatedModel _previewModel;
- private ContextMenuButton _showNodesButton, _showBoundsButton, _showFloorButton, _showNodesNamesButton;
+ private ContextMenuButton _showNodesButton, _showBoundsButton, _showFloorButton, _showNodesNamesButton, _nodeNameSizeButton;
private bool _showNodes, _showBounds, _showFloor, _showNodesNames;
private StaticModel _floorModel;
private bool _playAnimation, _playAnimationOnce;
@@ -110,9 +111,16 @@ namespace FlaxEditor.Viewport.Previews
ShowDebugDraw = true;
if (_showNodesNamesButton != null)
_showNodesNamesButton.Checked = value;
+ if (_nodeNameSizeButton != null)
+ _nodeNameSizeButton.Enabled = value;
}
}
+ ///
+ /// The font size used in the node name debug draw.
+ ///
+ public int NodeNamesSize = 10;
+
///
/// Gets or sets a value indicating whether show animated model bounding box debug view.
///
@@ -210,6 +218,15 @@ namespace FlaxEditor.Viewport.Previews
_showFloorButton.CloseMenuOnClick = false;
}
+ _nodeNameSizeButton = ViewWidgetButtonMenu.AddButton("Skeleton Names Size");
+ _nodeNameSizeButton.CloseMenuOnClick = false;
+ var nodeNameSizeValue = new IntValueBox(NodeNamesSize, 118, 2, 70.0f, 1, 32)
+ {
+ Parent = _nodeNameSizeButton
+ };
+ _nodeNameSizeButton.Enabled = ShowNodesNames;
+ nodeNameSizeValue.ValueChanged += () => NodeNamesSize = nodeNameSizeValue.Value;
+
// Enable shadows
PreviewLight.ShadowsMode = ShadowsCastingMode.All;
PreviewLight.CascadeCount = 3;
@@ -371,7 +388,7 @@ namespace FlaxEditor.Viewport.Previews
if (nodesMask != null && !nodesMask[nodeIndex])
continue;
//var t = new Transform(pose[nodeIndex].TranslationVector, Quaternion.Identity, new Float3(0.1f));
- DebugDraw.DrawText(nodes[nodeIndex].Name, pose[nodeIndex].TranslationVector, Color.White, 20, 0.0f, 0.1f);
+ DebugDraw.DrawText(nodes[nodeIndex].Name, pose[nodeIndex].TranslationVector, Color.White, NodeNamesSize, 0.0f, 0.25f);
}
}
}