Skip to content

Commit

Permalink
Fix FramesPerSecondCounter to render in screen space
Browse files Browse the repository at this point in the history
  • Loading branch information
puthre authored and prime31 committed Aug 11, 2022
1 parent 2e54fc3 commit 0c9faf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0c9faf1

Please sign in to comment.