Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUIImage.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_GUI_IMAGE_HPP_INCLUDED
6#define NIRT_I_GUI_IMAGE_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IGUIElement.hpp>
9
10namespace nirt
11{
12namespace video
13{
14 class ITexture;
15}
16namespace gui
17{
19 class IGUIImage : public IGUIElement
20 {
21 public:
22
24 IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
25 : IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {}
26
28 virtual void setImage(video::ITexture* image) = 0;
29
31 virtual video::ITexture* getImage() const = 0;
32
34
36 virtual void setColor(video::SColor color) = 0;
37
39 virtual void setScaleImage(bool scale) = 0;
40
42 virtual void setUseAlphaChannel(bool use) = 0;
43
45 virtual video::SColor getColor() const = 0;
46
48 virtual bool isImageScaled() const = 0;
49
51 virtual bool isAlphaChannelUsed() const = 0;
52
54
55 virtual void setSourceRect(const core::rect<s32>& sourceRect) = 0;
56
58
59 virtual core::rect<s32> getSourceRect() const = 0;
60
62
69 virtual void setDrawBounds(const core::rect<f32>& drawBoundUVs = core::rect<f32>(0.f, 0.f, 1.f, 1.f)) = 0;
70
72 virtual core::rect<f32> getDrawBounds() const = 0;
73
75
76 virtual void setDrawBackground(bool draw) = 0;
77
79
80 virtual bool isDrawBackgroundEnabled() const = 0;
81 };
82
83
84} // end namespace gui
85} // end namespace nirt
86
87#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Base class of all GUI elements.
Definition IGUIElement.hpp:24
virtual void draw()
Draws the element and its children.
Definition IGUIElement.hpp:331
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
GUI element displaying an image.
Definition IGUIImage.hpp:20
virtual core::rect< f32 > getDrawBounds() const =0
Get drawing-area restrictions.
virtual void setDrawBackground(bool draw)=0
Sets whether to draw a background color (EGDC_3D_DARK_SHADOW) when no texture is set.
virtual bool isAlphaChannelUsed() const =0
Returns true if the image is using the alpha channel, false if not.
virtual void setImage(video::ITexture *image)=0
Sets an image texture.
virtual void setColor(video::SColor color)=0
Sets the color of the image.
virtual void setUseAlphaChannel(bool use)=0
Sets if the image should use its alpha channel to draw itself.
virtual video::SColor getColor() const =0
Gets the color of the image.
virtual core::rect< s32 > getSourceRect() const =0
Returns the customized source rectangle of the image to be used.
IGUIImage(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUIImage.hpp:24
virtual void setScaleImage(bool scale)=0
Sets if the image should scale to fit the element.
virtual video::ITexture * getImage() const =0
Gets the image texture.
virtual bool isDrawBackgroundEnabled() const =0
Checks if a background is drawn when no texture is set.
virtual void setDrawBounds(const core::rect< f32 > &drawBoundUVs=core::rect< f32 >(0.f, 0.f, 1.f, 1.f))=0
Restrict drawing-area.
virtual bool isImageScaled() const =0
Returns true if the image is scaled to fit, false if not.
virtual void setSourceRect(const core::rect< s32 > &sourceRect)=0
Sets the source rectangle of the image. By default the full image is used.
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
@ EGUIET_IMAGE
An image (IGUIImage)
Definition EGUIElementTypes.hpp:47
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print