mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
"Smart" border color
This commit is contained in:
parent
085e2c2947
commit
e6c70d43a0
2 changed files with 3 additions and 1 deletions
|
@ -53,6 +53,7 @@ public class Capy64 : Game, IGame
|
|||
public Eventing.EventEmitter EventEmitter { get; private set; }
|
||||
public DiscordIntegration Discord { get; set; }
|
||||
|
||||
public Color BorderColor { get; set; } = Color.Black;
|
||||
public Borders Borders = new()
|
||||
{
|
||||
Top = 0,
|
||||
|
@ -220,7 +221,7 @@ public class Capy64 : Game, IGame
|
|||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp);
|
||||
GraphicsDevice.Clear(new Color(0x11, 0x11, 0x11));
|
||||
GraphicsDevice.Clear(BorderColor);
|
||||
|
||||
SpriteBatch.DrawRectangle(renderTarget.Bounds.Location.ToVector2() + new Vector2(Borders.Left, Borders.Top),
|
||||
new Size2(renderTarget.Bounds.Width * Scale, renderTarget.Bounds.Height * Scale), Color.Black, Math.Min(renderTarget.Bounds.Width, renderTarget.Bounds.Height), 0);
|
||||
|
|
|
@ -184,6 +184,7 @@ public class Drawing : IDisposable
|
|||
public void Clear(Color? color = default)
|
||||
{
|
||||
Color finalColor = color ?? Color.Black;
|
||||
Capy64.Instance.BorderColor = finalColor;
|
||||
_graphicsDevice.Clear(finalColor);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue