예제 #1
0
        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));
        }
예제 #2
0
        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);
        }