Skip to content

ModCS.RangeRect

The ModCS.RangeRect class represents Range Rects (Also known as Other Rects). Unlike Drawing Rects Range Rects are centered rectangles. They are used for things such as NPC hitboxes.

A ModCS.Rect is userdata. You may access and edit the following values from it:

Value Type Usage
front Pixel Unit The radius from the center to the left side of the rectangle.
top Pixel Unit The radius from the center to the top side of the rectangle.
back Pixel Unit The radius from the center to the right side of the rectangle.
bottom Pixel Unit The radius from the center to the bottom side of the rectangle.

ModCS.RangeRect.Create()

ModCS.RangeRect.Create(front, top, back, bottom)

Returns a ModCS.RangeRect.

All parameters are optional. If any parameters are given, the returned ModCS.RangeRect will use those parameters as Range Rect values.

ModCS.RangeRect.Set()

ModCS.RangeRect.Set(rect, front, top, back, bottom)

Sets the ModCS.RangeRect given in the rect parameter to a ModCS.RangeRect with the following parameters.