mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-07-18 19:41:54 +08:00
Add hitbox outline utility method
This commit is contained in:
@ -238,6 +238,20 @@ namespace Strawberry
|
||||
}
|
||||
}
|
||||
|
||||
public Rect SceneHitboxOutline
|
||||
{
|
||||
[Inline]
|
||||
get
|
||||
{
|
||||
Rect hb = Hitbox + Position;
|
||||
hb.X -= 1;
|
||||
hb.Y -= 1;
|
||||
hb.Width += 2;
|
||||
hb.Height += 2;
|
||||
return hb;
|
||||
}
|
||||
}
|
||||
|
||||
public int Left
|
||||
{
|
||||
[Inline]
|
||||
@ -463,6 +477,11 @@ namespace Strawberry
|
||||
Game.Batcher.Rect(SceneHitbox, color);
|
||||
}
|
||||
|
||||
public void DrawHitboxOutline(Color color)
|
||||
{
|
||||
Game.Batcher.Rect(SceneHitboxOutline, color);
|
||||
}
|
||||
|
||||
public T SceneAs<T>() where T : Scene
|
||||
{
|
||||
Runtime.Assert(Scene is T, "Scene type mismatch!");
|
||||
|
Reference in New Issue
Block a user