Skip to content

RectangleI

Generated from engine/math/rectanglei.h at 0f4f503. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the math module

Audience: game code.

#include "engine/math/rectanglei.h" · namespace labrador

struct RectangleI
int x = 0;
int y = 0;
int width = 0;
int height = 0;
RectangleI() = default;
RectangleI(const RectangleI&) = default;
RectangleI& operator=(const RectangleI&) = default;
constexpr RectangleI(int x, int y, int width, int height);
RectangleI(const Vector2I& position,
const Vector2I& size);
RectangleI(const Vector2F& position,
const Vector2F& size);
explicit RectangleI(const RectangleF& rectangle);

constexpr and defined here so zero is constant-initialised. See Vector2F's constants for what the dynamic alternative risks.

int left() const;
int top() const;
int right() const;
int bottom() const;
Vector2I position() const;
Vector2I size() const;
Vector2I top_left() const;
Vector2I bottom_right() const;
bool operator==(const RectangleI& other) const;
bool operator!=(const RectangleI& other) const;
bool contains(const Vector2I& point) const;
bool contains(const RectangleI& other) const;
void offset(int horizontal_amount, int vertical_amount);
void offset(const Vector2I& amount);
void set_position(const Vector2I& position);
void set_size(const Vector2I& size);
static const RectangleI zero;

Named in the public declarations above: RectangleF, Vector2F, Vector2I.

The files that include this header directly. A file can also reach it through another header.

Documentation for Labrador v0.3.0. Built from Labrador 0f4f503 of 2026-11-03.

All documentation versions