sneak/FNA/FnaExtensionMethods.cs

21 lines
453 B
C#
Raw Normal View History

2021-07-21 19:42:21 +00:00
using Microsoft.Xna.Framework;
namespace SemiColinGames {
public static class FnaExtensionMethods {
// Point
public static Vector2 ToVector2(this Point p) {
return new Vector2(p.X, p.Y);
}
// Rectangle
public static Point Size(this Rectangle r) {
return new Point(r.Width, r.Height);
}
// Vector2
public static Point ToPoint(this Vector2 v) {
return new Point((int) v.X, (int) v.Y);
}
}
}