Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when adding FramesPerSecondCounter component in Initialize #731

Open
puthre opened this issue Aug 11, 2022 · 0 comments
Open

Crash when adding FramesPerSecondCounter component in Initialize #731

puthre opened this issue Aug 11, 2022 · 0 comments

Comments

@puthre
Copy link
Contributor

puthre commented Aug 11, 2022

adding

var fps = scene.CreateEntity("fps");
fps.AddComponent(new FramesPerSecondCounter());

leads to:

Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key '∞' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Nez.BitmapFonts.BitmapFont.get_Item(Char character) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/Assets/BitmapFonts/BitmapFont.cs:line 150
   at Nez.BitmapFonts.BitmapFont.MeasureString(FontCharacterSource& text, Single maxWidth) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/Assets/BitmapFonts/BitmapFont.cs:line 351
   at Nez.BitmapFonts.BitmapFont.MeasureString(String text, Single maxWidth) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/Assets/BitmapFonts/BitmapFont.cs:line 305
   at Nez.BitmapFonts.BitmapFont.MeasureString(String text) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/Assets/BitmapFonts/BitmapFont.cs:line 292
   at Nez.TextComponent.UpdateSize() in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Components/Text/TextComponent.cs:line 119
   at Nez.TextComponent.SetText(String text) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Components/Text/TextComponent.cs:line 92
   at Nez.TextComponent.set_Text(String value) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Components/Text/TextComponent.cs:line 31
   at Nez.FramesPerSecondCounter.Update() in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Components/Text/FramesPerSecondCounter.cs:line 141
   at Nez.Entity.Update() in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Entity.cs:line 389
   at Nez.Scene.Update() in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/ECS/Scene.cs:line 402
   at Nez.Core.Update(GameTime gameTime) in /home/puthre/work/vr/TheMoonLeverage/src/Nez/Nez.Portable/Core.cs:line 257
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at TheMoonLeverageClient.Program.Main() in /home/puthre/work/vr/TheMoonLeverage/src/TheMoonLeverageClient/Program.cs:line 11


I will follow up with a PR in a moment.

@puthre puthre changed the title CRash when adding FramesPerSecondCounter component in Initialize Crash when adding FramesPerSecondCounter component in Initialize Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant