Example #1
0
        public override Rectangle GetBounds(GameObject obj)
        {
            if (InvisibleInGame || Shp == null)
            {
                return(Rectangle.Empty);
            }

            var bounds = ShpRenderer.GetBounds(obj, Shp, Props);

            bounds.Offset(obj.Tile.Dx * TileWidth / 2, (obj.Tile.Dy - obj.Tile.Z) * TileHeight / 2);
            bounds.Offset(Props.GetOffset(obj));
            return(bounds);
        }
Example #2
0
        public override Rectangle GetBounds(GameObject obj)
        {
            if (InvisibleInGame || terrainShp?.Shp == null)
            {
                return(Rectangle.Empty);
            }
            var renderer = new ShpRenderer(_config, _vfs);
            var bounds   = renderer.GetBounds(obj, terrainShp.Shp, Props);

            bounds.Offset(obj.Tile.Dx * _config.TileWidth / 2, (obj.Tile.Dy - obj.Tile.Z) * _config.TileHeight / 2);
            bounds.Offset(Props.GetOffset(obj));
            return(bounds);
        }