View.cpp
1// Copyright 2019 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4
5#include <smk/View.hpp>
6
7namespace smk {
8
9/// @brief Set the center position of the in-game view.
10/// param x The center of the view along the horizontal axis.
11/// param y The center of the view along the vertical axis.
12void View::SetCenter(float x, float y) {
13 x_ = x;
14 y_ = y;
15}
16
17/// @brief Set the center position of the in-game view.
18/// param center The center of the view.
19void View::SetCenter(const glm::vec2& center) {
20 SetCenter(center.x, center.y);
21}
22
23/// @brief Set the size of the in-game view.
24/// param width The size of the view along the horizontal axis.
25/// param height The size of the view along the vertical axis.
26void View::SetSize(float width, float height) {
27 width_ = width;
28 height_ = height;
29}
30
31/// @brief Set the size of the in-game view.
32/// param center The size of the view.
33void View::SetSize(const glm::vec2& size) {
34 SetSize(size.x, size.y);
35}
36
37} // namespace smk
float x_
<
Definition: View.hpp:27
void SetCenter(float x, float y)
Set the center position of the in-game view. param x The center of the view along the horizontal axis...
Definition: View.cpp:12
void SetSize(float width, float height)
Set the size of the in-game view. param width The size of the view along the horizontal axis....
Definition: View.cpp:26