Added Base Project
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using SFML.Graphics;
|
||||
using SFML.System;
|
||||
|
||||
namespace Firebird2D.SFMLExtensions
|
||||
{
|
||||
public static class FloatRectangeExtension
|
||||
{
|
||||
public static bool Contains(this FloatRect rect, FloatRect other)
|
||||
{
|
||||
return (other.Left >= rect.Left) &&
|
||||
(other.Top >= rect.Top) &&
|
||||
(other.Left + other.Width <= rect.Left + rect.Width) &&
|
||||
(other.Top + other.Height <= rect.Top + rect.Height);
|
||||
}
|
||||
|
||||
public static Vector2f Location(this FloatRect rect) { return new Vector2f(rect.Left, rect.Top); }
|
||||
|
||||
public static Vector2f Center(this FloatRect rect) { return new Vector2f(rect.Left + rect.Width /2, rect.Top + rect.Height /2);}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user