RectangleI
Generated from engine/math/rectanglei.h at f525bc6. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
Audience: game code.
#include "engine/math/rectanglei.h" · namespace labrador
struct RectangleI
Section titled “struct RectangleI”int x = 0;int y = 0;int width = 0;height
Section titled “height”int height = 0;RectangleI · operator=
Section titled “RectangleI · operator=”RectangleI(const RectangleI&) = default;RectangleI& operator=(const RectangleI&) = default;RectangleI
Section titled “RectangleI” const Vector2I& size);constexpr and defined here so zero is constant-initialised. See Vector2F's constants for what the dynamic alternative risks.
RectangleI
Section titled “RectangleI” const Vector2F& size);Each of x, y, width and height truncates toward zero on its own, as static_cast<int> does; the corners are not rounded outward, so (0.5, 0.5, 2.9, 2.9) becomes (0, 0, 2, 2). Both float constructors throw std::invalid_argument for non-finite input and std::out_of_range if a truncated field does not fit in int.
left · top · right · bottom
Section titled “left · top · right · bottom”int left() const;int top() const;int right() const;int bottom() const;right() is x + width and bottom() is y + height.
position · size
Section titled “position · size”Vector2I size() const;top_left · bottom_right
Section titled “top_left · bottom_right”Vector2I bottom_right() const;operator== · operator!=
Section titled “operator== · operator!=”bool operator!=(const RectangleI& other) const;contains
Section titled “contains”Both are inclusive at all four edges: a point on right() or bottom() is contained, and a rectangle contains itself.
offset · set_position · set_size
Section titled “offset · set_position · set_size”void offset(int horizontal_amount, int vertical_amount);void set_position(const Vector2I& position);void set_size(const Vector2I& size);offset and set_position move the rectangle and keep its size; set_size keeps the top left.
Related types
Section titled “Related types”Named in the public declarations above: RectangleF, Vector2F, Vector2I.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
samples/collision/body.cpp,entry_marker.cppsamples/components/animation_preview_content_tests.cpp,animation_preview_test_content.h,gallery_state.cpp,nine_slice.h,nine_slice_tests.cpp,shape_outline.cpp,slider.cpp,test_content.h,text_field_null_tests.cpp,text_field_tests.cpp,widget_draw_null_tests.cppsamples/linesweeper/presentation/board_view.cpp,particles.cpp,top_out_banner.cpp,touch_controls.cppsamples/linesweeper/states/pause_state.cppsamples/local_multiplayer/arena.cpptests/assets/grid_sheet_loader_tests.cpp,sprite_sheet_loader_tests.cpp,sprite_sheet_resource_tests.cpp,string_table_text_tests.cpptests/linesweeper/top_out_banner_tests.cpptests/math/constant_initialisation_tests.cpp,integer_geometry_tests.cpptests/render/animation_strip_tests.cpp,font_tests.cpp,label_tests.cpp,null_resource_tests.cpp,null_synthetic_harness.h,null_test_harness.h,page_crossing_frame.h,pixel_test_harness.h,pixel_tests.cpp,presentation_lifecycle_tests.cpp,render_resources_tests.cpp,resource_pixel_tests.cpp,sprite_geometry_tests.cpp,sprite_pixel_tests.cpp,sprite_sheet_object_tests.cpp,text_alignment_tests.cpp,text_pixel_tests.cpp,text_tests.cpp,view_pixel_tests.cpp,viewport_tests.cpp,visual_tests.cpptests/render/d3d12/submit_allocation_tests.cpp,texture_replacement_tests.cpptests/render/vulkan/submit_allocation_tests.cpp,submit_failure_tests.cpptests/render/web/context_loss_tests.cpptests/scene/cull_tests.cpp,fanout_tests.cpp,order_tests.cpp
Explained in
Section titled “Explained in”Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.