Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1#pragma once
2
7
20class Image : public Renderable {
21 public:
22 Image(const std::string& image, int flip_x, int flip_y, int width, int height,
23 Color color); // NOLINT
24
25 void update(float dt) override;
26
27 [[nodiscard]] int flip_x() const;
28 Image& flip_x(int val);
29
30 [[nodiscard]] int flip_y() const;
31 Image& flip_y(int val);
32
33 [[nodiscard]] int width() const;
34 Image& width(int val);
35
36 [[nodiscard]] int height() const;
37 Image& height(int val);
38
39 [[nodiscard]] Color color() const;
41
42 [[nodiscard]] const Texture& texture() const;
43 Image& texture(const std::string& name);
45
46 std::string type_name() const override;
47
48 private:
49 std::reference_wrapper<Texture> texture_;
50 int flip_x_;
51 int flip_y_;
52 int width_;
53 int height_;
54 Color color_;
55
56 std::reference_wrapper<Texture> get_texture_for(const std::string& name);
57};
Represents a color with red, green, blue, and alpha components. Each component is represented as an u...
Definition color.h:7
A UI component for displaying images.
Definition image.h:20
int height() const
Image & flip_y(int val)
Image & texture(const std::string &name)
Image & flip_x(int val)
int flip_y() const
Color color() const
std::string type_name() const override
Provides a consistent type name for the component.
Image & color(Color color)
int flip_x() const
Image(const std::string &image, int flip_x, int flip_y, int width, int height, Color color)
void update(float dt) override
const Texture & texture() const
Image & height(int val)
int width() const
Image & texture(Texture &texture)
Image & width(int val)
Base class for renderable components in the engine.
Definition renderable.h:16
Represents a texture used in rendering game objects. Encapsulates an SDL_Texture and provides access ...
Definition texture.h:10