2020-12-10 21:53:55 +00:00
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
namespace Kav.Data
|
|
|
|
{
|
|
|
|
public struct UVData
|
|
|
|
{
|
|
|
|
public Vector2 Offset { get; }
|
|
|
|
public Vector2 Percentage { get; }
|
|
|
|
|
|
|
|
public UVData(
|
|
|
|
Vector2 positionInAtlas,
|
|
|
|
Vector2 subTextureDimensions,
|
|
|
|
Vector2 atlasDimensions
|
|
|
|
) {
|
|
|
|
Percentage = subTextureDimensions / atlasDimensions;
|
|
|
|
Offset = positionInAtlas / atlasDimensions;
|
|
|
|
}
|
2020-12-11 00:02:13 +00:00
|
|
|
|
|
|
|
public Vector4 ToVector4()
|
|
|
|
{
|
|
|
|
return new Vector4(Offset.X, Offset.Y, Percentage.X, Percentage.Y);
|
|
|
|
}
|
2020-12-10 21:53:55 +00:00
|
|
|
}
|
|
|
|
}
|