#include <View.hpp>
Represent the area in the game to be drawn on the screen. To preserve the screen ratio, the view ratio must be the same.
- Examples
- rounded_rectangle.cpp.
Definition at line 14 of file View.hpp.
|
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. param y The center of the view along the vertical axis. More...
|
|
void | SetCenter (const glm::vec2 ¢er) |
| Set the center position of the in-game view. param center The center of the view. More...
|
|
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. param height The size of the view along the vertical axis. More...
|
|
void | SetSize (const glm::vec2 &size) |
| Set the size of the in-game view. param center The size of the view. More...
|
|
float | Left () const |
|
float | Right () const |
| < More...
|
|
float | Top () const |
| < More...
|
|
float | Bottom () const |
| < More...
|
|
◆ Bottom()
float smk::View::Bottom |
( |
| ) |
const |
|
inline |
<
Definition at line 24 of file View.hpp.
24{ return y_ + height_ / 2; };
◆ Left()
float smk::View::Left |
( |
| ) |
const |
|
inline |
Definition at line 21 of file View.hpp.
21{
return x_ - width_ / 2; };
◆ Right()
float smk::View::Right |
( |
| ) |
const |
|
inline |
<
Definition at line 22 of file View.hpp.
22{
return x_ + width_ / 2; };
◆ SetCenter() [1/2]
void smk::View::SetCenter |
( |
const glm::vec2 & |
center | ) |
|
Set the center position of the in-game view. param center The center of the view.
Definition at line 19 of file View.cpp.
19 {
21}
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...
◆ SetCenter() [2/2]
void smk::View::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. param y The center of the view along the vertical axis.
- Examples
- rounded_rectangle.cpp.
Definition at line 12 of file View.cpp.
◆ SetSize() [1/2]
void smk::View::SetSize |
( |
const glm::vec2 & |
size | ) |
|
Set the size of the in-game view. param center The size of the view.
Definition at line 33 of file View.cpp.
33 {
35}
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....
◆ SetSize() [2/2]
void smk::View::SetSize |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
Set the size of the in-game view. param width The size of the view along the horizontal axis. param height The size of the view along the vertical axis.
- Examples
- rounded_rectangle.cpp.
Definition at line 26 of file View.cpp.
26 {
27 width_ = width;
28 height_ = height;
29}
◆ Top()
float smk::View::Top |
( |
| ) |
const |
|
inline |
<
Definition at line 23 of file View.hpp.
23{ return y_ - height_ / 2; };
◆ height_
float smk::View::height_ = 0.f |
◆ width_
float smk::View::width_ = 0.f |
◆ x_
float smk::View::x_ = 0.f |
◆ y_
float smk::View::y_ = 0.f |
The documentation for this class was generated from the following files:
- /home/arthursonzogni/programmation/real/smk/include/smk/View.hpp
- /home/arthursonzogni/programmation/real/smk/src/smk/View.cpp