# bound_pixloc proc

Source: https://ref.dm-lang.org/proc/bound_pixloc
Added in BYOND 516.

### Format
> `bound_pixloc(Atom, Dir)`

### Returns
> A `pixloc` object representing a corner, side, or center of atom bounds.

### Args
- `Atom`: An atom.
- `Dir`: The side or corner to use, or 0 for center.


Creates a new `pixloc` object based on an existing object's bounds. If either `bound_x` or `bound_y` are nonzero, then `bound_pixloc(atom, SOUTHWEST)` will differ from `atom.pixloc`.

If the atom is not directly on the map, this value is null.

```dm /bound_pixloc/
mob/verb/DistanceTo(atom/A)
    var/my_center = bound_pixloc(src, 0)
    var/A_center = bound_pixloc(A, 0)
    var/vector/V = A_center - my_center
    return length(V)
```

### See also
- [pixloc](https://ref.dm-lang.org/pixloc/index.md)
- [pixloc var (atom)](https://ref.dm-lang.org/atom/var/pixloc.md)
- [pixloc proc](https://ref.dm-lang.org/proc/pixloc.md)
- [bound_width var (movable atom)](https://ref.dm-lang.org/atom/movable/var/bound_width.md)
- [bound_height var (movable atom)](https://ref.dm-lang.org/atom/movable/var/bound_height.md)
