From 0c9faf131f3582596b13c3d81f5981e1cbf2e4b0 Mon Sep 17 00:00:00 2001 From: Valentin Zagura Date: Thu, 11 Aug 2022 21:22:59 +0100 Subject: [PATCH] Fix FramesPerSecondCounter to render in screen space --- Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs b/Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs index 5be481319..38081e2b3 100644 --- a/Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs +++ b/Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs @@ -149,8 +149,9 @@ public override bool IsVisibleFromCamera(Camera camera) public override void Render(Batcher batcher, Camera camera) { // we override render and use position instead of entityPosition. this keeps the text in place even if the entity moves - batcher.DrawString(_font, _text, LocalOffset, Color, Entity.Transform.Rotation, Origin, - Entity.Transform.Scale, SpriteEffects, LayerDepth); + batcher.DrawString(_font, _text, camera.ScreenToWorldPoint(_localOffset), Color, Entity.Transform.Rotation, Origin, + Entity.Transform.Scale/camera.RawZoom, SpriteEffects, LayerDepth); + } public override void DebugRender(Batcher batcher)