bn::rect_window class

Rectangular window.

Base classes

class inside_window
Window which region can be covered by other window.

Public static functions

static auto internal() -> rect_window
Returns the closest window to the screen.
static auto external() -> rect_window
Returns the closest window to the screen not covered by the internal window.

Public functions

auto top() const -> fixed
Returns the position of the top boundary of this window (relative to its camera, if it has one).
void set_top(fixed top)
Sets the position of the top boundary of this window (relative to its camera, if it has one).
auto left() const -> fixed
Returns the position of the left boundary of this window (relative to its camera, if it has one).
void set_left(fixed left)
Sets the position of the left boundary of this window (relative to its camera, if it has one).
auto top_left() const -> const fixed_point&
Returns the position of the top-left corner of this window (relative to its camera, if it has one).
void set_top_left(fixed top, fixed left)
Sets the position of the top-left corner of this window (relative to its camera, if it has one).
void set_top_left(const fixed_point& top_left)
Sets the position of the top-left corner of this window (relative to its camera, if it has one).
auto bottom() const -> fixed
Returns the position of the bottom boundary of this window (relative to its camera, if it has one).
void set_bottom(fixed bottom)
Sets the position of the bottom boundary of this window (relative to its camera, if it has one).
auto right() const -> fixed
Returns the position of the right boundary of this window (relative to its camera, if it has one).
void set_right(fixed right)
Sets the position of the right boundary of this window (relative to its camera, if it has one).
auto bottom_right() const -> const fixed_point&
Returns the position of the bottom-right corner of this window (relative to its camera, if it has one).
void set_bottom_right(fixed bottom, fixed right)
Sets the position of the bottom-right corner of this window (relative to its camera, if it has one).
void set_bottom_right(const fixed_point& bottom_right)
Sets the position of the bottom-right corner of this window (relative to its camera, if it has one).
auto boundaries() const -> fixed_rect
Returns the boundaries of this window (relative to its camera, if it has one) as a fixed_rect.
auto top_left_boundaries() const -> top_left_fixed_rect
Returns the boundaries of this window (relative to its camera, if it has one) as a top_left_fixed_rect.
void set_boundaries(fixed top, fixed left, fixed bottom, fixed right)
Sets the boundaries of this window (relative to its camera, if it has one).
void set_boundaries(const fixed_point& top_left, const fixed_point& bottom_right)
Sets the boundaries of this window (relative to its camera, if it has one).
void set_boundaries(const fixed_rect& boundaries)
Sets the boundaries of this window (relative to its camera, if it has one).
void set_boundaries(const top_left_fixed_rect& boundaries)
Sets the boundaries of this window (relative to its camera, if it has one).
void restore_boundaries()
Restores the boundaries of this window to its initial values.
auto camera() const -> const optional<camera_ptr>&
Returns the camera_ptr attached to this rect window (if any).
void set_camera(const camera_ptr& camera)
Sets the camera_ptr attached to this rect window.
void set_camera(camera_ptr&& camera)
Sets the camera_ptr attached to this rect window.
void set_camera(const optional<camera_ptr>& camera)
Sets or removes the camera_ptr attached to this rect window.
void set_camera(optional<camera_ptr>&& camera)
Sets or removes the camera_ptr attached to this rect window.
void remove_camera()
Removes the camera_ptr attached to this rect window (if any).

Function documentation

void bn::rect_window::set_top_left(fixed top, fixed left)

Sets the position of the top-left corner of this window (relative to its camera, if it has one).

Parameters
top Position of the top boundary of this window (relative to its camera, if it has one).
left Position of the left boundary of this window (relative to its camera, if it has one).

void bn::rect_window::set_bottom_right(fixed bottom, fixed right)

Sets the position of the bottom-right corner of this window (relative to its camera, if it has one).

Parameters
bottom Position of the bottom boundary of this window (relative to its camera, if it has one).
right Position of the right boundary of this window (relative to its camera, if it has one).

void bn::rect_window::set_boundaries(fixed top, fixed left, fixed bottom, fixed right)

Sets the boundaries of this window (relative to its camera, if it has one).

Parameters
top Position of the top boundary of this window (relative to its camera, if it has one).
left Position of the left boundary of this window (relative to its camera, if it has one).
bottom Position of the bottom boundary of this window (relative to its camera, if it has one).
right Position of the right boundary of this window (relative to its camera, if it has one).

void bn::rect_window::set_boundaries(const fixed_point& top_left, const fixed_point& bottom_right)

Sets the boundaries of this window (relative to its camera, if it has one).

Parameters
top_left Position of the top-left corner of this window (relative to its camera, if it has one).
bottom_right Position of the bottom-right corner of this window (relative to its camera, if it has one).

void bn::rect_window::set_camera(const camera_ptr& camera)

Sets the camera_ptr attached to this rect window.

Parameters
camera camera_ptr to copy to this rect window.

void bn::rect_window::set_camera(camera_ptr&& camera)

Sets the camera_ptr attached to this rect window.

Parameters
camera camera_ptr to move to this rect window.

void bn::rect_window::set_camera(const optional<camera_ptr>& camera)

Sets or removes the camera_ptr attached to this rect window.

Parameters
camera Optional camera_ptr to copy to this rect window.

void bn::rect_window::set_camera(optional<camera_ptr>&& camera)

Sets or removes the camera_ptr attached to this rect window.

Parameters
camera Optional camera_ptr to move to this rect window.