refactor: moved font loading to label
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
using Syntriax.Engine.Integration.MonoGame;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate, ILoadContent
|
||||
public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate
|
||||
{
|
||||
public readonly bool IsLeft = IsLeft;
|
||||
|
||||
@@ -22,11 +18,6 @@ public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate, ILoadContent
|
||||
UpdateScores(pongManager);
|
||||
}
|
||||
|
||||
public void LoadContent(ContentManager content)
|
||||
{
|
||||
Font = content.Load<SpriteFont>("UbuntuMono");
|
||||
}
|
||||
|
||||
private void UpdateScores(PongManager pongManager)
|
||||
{
|
||||
if (IsLeft)
|
||||
|
||||
Reference in New Issue
Block a user