21 lines
453 B
C#
21 lines
453 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|