Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1#pragma once
2
5
18class Camera final : public GameObject {
19 private:
20 Color backgroundColor_;
21 float zoom_{1.0f};
22 bool isMain_{false};
23
24 public:
25 explicit Camera(Scene& scene, Color backgroundColor, float zoom, bool isMain);
26
32 void set_background_color(const Color& color);
34
41 void set_zoom(float zoom);
42 [[nodiscard]] float zoom() const;
43
48 void set_main();
50 [[nodiscard]] bool is_main() const;
51
56 [[nodiscard]] int get_screen_width() const;
57
63};
Camera GameObject class Inherits from GameObject class and represents a camera in the scene....
Definition camera.h:18
void set_background_color(const Color &color)
Sets the background color of the camera.
void set_main()
The main camera is the one used for rendering the primary view of the scene. Only one camera can be t...
int get_screen_height() const
Retrieves the current screen height in pixels.
Camera(Scene &scene, Color backgroundColor, float zoom, bool isMain)
bool is_main() const
void set_not_main()
void set_zoom(float zoom)
Sets the zoom level of the camera.
int get_screen_width() const
Retrieves the current screen width in pixels.
float zoom() const
Color background_color() const
Represents a color with red, green, blue, and alpha components. Each component is represented as an u...
Definition color.h:7
Concept to constrain types to be derived from Component.
Definition gameObject.h:33
std::optional< std::reference_wrapper< T > > get_component() const noexcept
Get the first component of type T attached to this GameObject.
Definition gameObject.h:141
Scene & scene() const noexcept
Represents a scene within the engine. A scene contains multiple GameObjects and manages their lifecyc...
Definition scene.h:19