mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
* artemis ecs * Working on StarWarrior * Refactor for bugs * demo works :) * Fix pool bug * Fix string typo * ObjectPool garbage optimization * Aspect attribute * Remove BigInteger * Fix demo * Refactor for events * wip on platformer demo * Fix typo
56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using System;
|
|
using Microsoft.Xna.Framework;
|
|
|
|
namespace MonoGame.Extended
|
|
{
|
|
public abstract class SimpleDrawableGameComponent : SimpleGameComponent, IDrawable
|
|
{
|
|
private int _drawOrder;
|
|
private bool _isVisible;
|
|
|
|
protected SimpleDrawableGameComponent()
|
|
{
|
|
}
|
|
|
|
public bool Visible
|
|
{
|
|
get { return _isVisible; }
|
|
set
|
|
{
|
|
if (_isVisible == value)
|
|
return;
|
|
|
|
_isVisible = value;
|
|
VisibleChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
bool IDrawable.Visible => _isVisible;
|
|
|
|
public int DrawOrder
|
|
{
|
|
get { return _drawOrder; }
|
|
set
|
|
{
|
|
if (_drawOrder == value)
|
|
return;
|
|
|
|
_drawOrder = value;
|
|
DrawOrderChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
public event EventHandler<EventArgs> DrawOrderChanged;
|
|
public event EventHandler<EventArgs> VisibleChanged;
|
|
|
|
public abstract void Draw(GameTime gameTime);
|
|
|
|
protected virtual void LoadContent()
|
|
{
|
|
}
|
|
|
|
protected virtual void UnloadContent()
|
|
{
|
|
}
|
|
}
|
|
} |