class SFML::Rect

An axis-aligned rectangle. Mirrors sfFloatRect / sfIntRect — those structs are just (position: Vector2, size: Vector2). We deliberately keep one Ruby class for both the float and int variants since pattern-matching case bounds in {position: {x:, y:}, size: {x: w, y: h}} is what users reach for either way.

r = SFML::Rect.new([10, 20], [100, 50]) r.contains?([50, 30]) #=> true r.right #=> 110

Used by Text#local_bounds, Text#global_bounds, Sprite#texture_rect, etc.