private bool EntityBounded(EntityPlacement entityInfo, Point location) { Entity entity = Stage.Project.EntityByName(entityInfo.entity); MegaMan.Common.Geometry.RectangleF bounds; if (entity.MainSprite == null) { bounds = new MegaMan.Common.Geometry.RectangleF(-8, -8, 16, 16); } else { bounds = entity.MainSprite.BoundBox; bounds.Offset(-entity.MainSprite.HotSpot.X, -entity.MainSprite.HotSpot.Y); } bounds.Offset(entityInfo.screenX, entityInfo.screenY); return(bounds.Contains(location)); }
private bool EntityBounded(EntityPlacement entityInfo, Point location) { Entity entity = Stage.Project.EntityByName(entityInfo.entity); MegaMan.Common.Geometry.RectangleF bounds; if (entity.MainSprite == null) { bounds = new MegaMan.Common.Geometry.RectangleF(-8, -8, 16, 16); } else { bounds = entity.MainSprite.BoundBox; bounds.Offset(-entity.MainSprite.HotSpot.X, -entity.MainSprite.HotSpot.Y); } bounds.Offset(entityInfo.screenX, entityInfo.screenY); return bounds.Contains(location); }