.. _api_Image: Image ===== Inherited: None .. _api_Image_description: Description ----------- The Image class represents an image or sprite that can be rendered and displayed on the screen within a graphical user interface (GUI). It is used to incorporate visual elements into the interface, such as icons, backgrounds, or illustrations, by loading and rendering image files. .. _api_Image_public: Public Methods -------------- +----------------------------------+-----------------------------------------------------------------+ | :ref:`Vector4` | :ref:`color` () const | +----------------------------------+-----------------------------------------------------------------+ | int | :ref:`drawMode` () const | +----------------------------------+-----------------------------------------------------------------+ | std::string | :ref:`item` () const | +----------------------------------+-----------------------------------------------------------------+ | :ref:`Material` * | :ref:`material` () const | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setColor` (const Vector4 color) | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setDrawMode` (int mode) | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setItem` (const std::string item) | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setMaterial` (Material * material) | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setSprite` (Sprite * sheet) | +----------------------------------+-----------------------------------------------------------------+ | void | :ref:`setTexture` (Texture * image) | +----------------------------------+-----------------------------------------------------------------+ | :ref:`Sprite` * | :ref:`sprite` () const | +----------------------------------+-----------------------------------------------------------------+ .. _api_Image_static: Static Methods -------------- None .. _api_Image_methods: Methods Description ------------------- .. _api_Image_color: :ref:`Vector4` **Image::color** () const Returns the color of the image to be drawn. **See also** setColor(). ---- .. _api_Image_drawMode: int **Image::drawMode** () const Returns a draw mode for the image. Please check Image::DrawMode for more details. **See also** setDrawMode(). ---- .. _api_Image_item: std::string **Image::item** () const Returns the current item name of sprite from the sprite sheet. **See also** setItem(). ---- .. _api_Image_material: :ref:`Material` * **Image::material** () const Returns an instantiated Material assigned to Image. **See also** setMaterial(). ---- .. _api_Image_setColor: void **Image::setColor** (:ref:`Vector4` *color*) Changes the *color* of the image to be drawn. **See also** *color*(). ---- .. _api_Image_setDrawMode: void **Image::setDrawMode** (int *mode*) Sets a draw *mode* for the image. Please check Image::DrawMode for more details. **See also** drawMode(). ---- .. _api_Image_setItem: void **Image::setItem** (std::string *item*) Sets the current sub *item* name of sprite from the sprite sheet. **See also** *item*(). ---- .. _api_Image_setMaterial: void **Image::setMaterial** (:ref:`Material` * *material*) Creates a new instance of *material* and assigns it. **See also** *material*(). ---- .. _api_Image_setSprite: void **Image::setSprite** (:ref:`Sprite` * *sheet*) Replaces the current sprite *sheet* with a new one. **See also** sprite(). ---- .. _api_Image_setTexture: void **Image::setTexture** (:ref:`Texture` * *image*) Replaces the current *image* with a new one. ---- .. _api_Image_sprite: :ref:`Sprite` * **Image::sprite** () const Returns the sprite assigned to the Image. **See also** setSprite().