|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
A UI component for displaying images. More...
#include <image.h>
Public Member Functions | |
| Image (const std::string &image, int flip_x, int flip_y, int width, int height, Color color) | |
| void | update (float dt) override |
| int | flip_x () const |
| Image & | flip_x (int val) |
| int | flip_y () const |
| Image & | flip_y (int val) |
| int | width () const |
| Image & | width (int val) |
| int | height () const |
| Image & | height (int val) |
| Color | color () const |
| Image & | color (Color color) |
| const Texture & | texture () const |
| Image & | texture (const std::string &name) |
| Image & | texture (Texture &texture) |
| std::string | type_name () const override |
| Provides a consistent type name for the component. | |
Public Member Functions inherited from Renderable | |
| Renderable () | |
| Renderable (int layer) | |
| ~Renderable () override=default | |
| Renderable & | order_in_layer (int layer) |
| int | order_in_layer () const |
| void | set_render_strategy (Component &component) |
| virtual IRenderingStrategy & | render_strategy () const |
| std::string | type_name () const override |
| Provides a consistent type name for the component. | |
| Renderable & | disable_draw () noexcept |
| Renderable & | enable_draw () noexcept |
| bool | should_draw () const noexcept |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=default |
| bool | active () const noexcept |
| Checks if the component is active. | |
| Component & | active (bool value) noexcept |
| bool | marked_for_deletion () const noexcept |
| Activates the component. | |
| Component & | mark_for_deletion () noexcept |
| virtual void | on_attach () |
| Called when the component is attached to a GameObject. | |
| virtual void | on_detach () |
| Called when the component is detached from a GameObject. | |
| virtual void | on_serialize (std::vector< uint8_t > &) const |
| Serializes the component's state into a byte array. | |
| virtual void | on_deserialize (const std::vector< uint8_t > &, size_t &) |
| Deserializes the component's state from a byte array. | |
| const std::optional< std::reference_wrapper< GameObject > > & | parent () const noexcept |
| Gets the parent GameObject of this component. | |
| std::optional< std::reference_wrapper< GameObject > > & | parent () noexcept |
| Gets the parent GameObject of this component. | |
| Component & | parent (GameObject &parent) |
| Component & | parent (std::nullopt_t nullopt) |
| size_t | add_on_attach (const std::function< void(Component &)> &action) |
| Retrieves the type information of the component. | |
| void | remove_on_attach (size_t index) |
| size_t | add_on_detach (const std::function< void(Component &)> &action) |
| Adds an action to be performed when the component is attached. | |
| void | remove_on_detach (size_t index) |
Additional Inherited Members | |
Protected Attributes inherited from Renderable | |
| std::unique_ptr< IRenderingStrategy > | render_strategy_ |
| int | ordering_layer_ = 0 |
| bool | draw {true} |
A UI component for displaying images.
The Image component allows you to display images in the UI. You can set various properties such as flipping, size, and color tinting.
Usage:
| Image::Image | ( | const std::string & | image, |
| int | flip_x, | ||
| int | flip_y, | ||
| int | width, | ||
| int | height, | ||
| Color | color | ||
| ) |
| Color Image::color | ( | ) | const |
| int Image::flip_x | ( | ) | const |
| Image & Image::flip_x | ( | int | val | ) |
| int Image::flip_y | ( | ) | const |
| Image & Image::flip_y | ( | int | val | ) |
| int Image::height | ( | ) | const |
| Image & Image::height | ( | int | val | ) |
| const Texture & Image::texture | ( | ) | const |
| Image & Image::texture | ( | const std::string & | name | ) |
|
overridevirtual |
Provides a consistent type name for the component.
Implements Component.
|
overridevirtual |
Implements Component.
| int Image::width | ( | ) | const |
| Image & Image::width | ( | int | val | ) |