31 lines
545 B
C#
31 lines
545 B
C#
|
|
using System;
|
|
using Microsoft.Xna.Framework.Content;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
namespace MonoGameBlank2dStartKit.Core.Content;
|
|
|
|
public class Assets
|
|
{
|
|
private readonly Texture2D[] _images;
|
|
|
|
public Assets(ContentManager content)
|
|
{
|
|
var allImageIds = Enum.GetValues<ImageId>();
|
|
_images =
|
|
[
|
|
content.Load<Texture2D>("Images/ball"),
|
|
];
|
|
}
|
|
|
|
public Texture2D GetTexture2D(ImageId imageId)
|
|
{
|
|
return _images[(int)imageId];
|
|
}
|
|
}
|
|
|
|
public enum ImageId
|
|
{
|
|
Ball
|
|
}
|