The runtime cost for a bone is quite small. It's unlikely to be a bottleneck to have a few more bones.
You would only need 2 bones to define the corners of a rectangle.
Another option could be to use 2 point attachments. They have only a position and rotation, so are lighter to compute the world position. You would ignore rotation (which isn't used to compute the position anyway).
Another option is to use a mesh or region attachment. A mesh would allow you to have a polygon instead of a rectangle. In the editor you could use a translucent image. Don't render the attachment, just compute its world vertices and use them for movement restriction.
Another option is to just hardcode the world coordinates of your rectangle in your code, if it's not dynamic. This is the most efficient way, since you don't need to compute local to world coordinates.
You could use event values as a way to get a value you define in the editor to your runtime code. You don't need to ever key the events, just find each event and get out its float value. Eg, 4 events with world coordinates: x1, y1, x2, y2. ctrl+shift+R
to better visualize world coordinates.
If needed, you could create your own constraint at runtime. This is more involved (need to modify Skeleton updateCache
) but would allow you to restrict the bone position in the middle of the draw order.