Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
guiButtonImage.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "guiButton.h"
8#include "IGUIButton.h"
9#include "guiAnimatedImage.h"
10#include "irr_ptr.h"
11
12using namespace irr;
13
15{
16public:
18 GUIButtonImage(gui::IGUIEnvironment *environment, gui::IGUIElement *parent,
19 s32 id, core::rect<s32> rectangle, ISimpleTextureSource *tsrc,
20 bool noclip = false);
21
22 void setForegroundImage(irr_ptr<video::ITexture> image = nullptr,
23 const core::rect<s32> &middle = core::rect<s32>());
24
26 virtual void setFromStyle(const StyleSpec &style) override;
27
29 static GUIButtonImage *addButton(gui::IGUIEnvironment *environment,
30 const core::rect<s32> &rectangle, ISimpleTextureSource *tsrc,
31 IGUIElement *parent, s32 id, const wchar_t *text,
32 const wchar_t *tooltiptext = L"");
33
34private:
35 irr_ptr<video::ITexture> m_foreground_image;
36 irr_ptr<GUIAnimatedImage> m_image;
37};
Definition guiButtonImage.h:15
irr_ptr< video::ITexture > m_foreground_image
Definition guiButtonImage.h:35
void setForegroundImage(irr_ptr< video::ITexture > image=nullptr, const core::rect< s32 > &middle=core::rect< s32 >())
Definition guiButtonImage.cpp:27
irr_ptr< GUIAnimatedImage > m_image
Definition guiButtonImage.h:36
GUIButtonImage(gui::IGUIEnvironment *environment, gui::IGUIElement *parent, s32 id, core::rect< s32 > rectangle, ISimpleTextureSource *tsrc, bool noclip=false)
constructor
Definition guiButtonImage.cpp:17
virtual void setFromStyle(const StyleSpec &style) override
Set element properties from a StyleSpec.
Definition guiButtonImage.cpp:39
static GUIButtonImage * addButton(gui::IGUIEnvironment *environment, const core::rect< s32 > &rectangle, ISimpleTextureSource *tsrc, IGUIElement *parent, s32 id, const wchar_t *text, const wchar_t *tooltiptext=L"")
Do not drop returned handle.
Definition guiButtonImage.cpp:57
Definition guiButton.h:20
Definition texturesource.h:25
Definition StyleSpec.h:18
Definition clientmap.h:30