GlistEngine
Loading...
Searching...
No Matches
gGUIImageButton.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2014 Nitra Games Ltd., Istanbul, Turkey *
3
* *
4
* Permission is hereby granted, free of charge, to any person obtaining a *
5
* copy of this software and associated documentation files (the *
6
* "Software"), to deal in the Software without restriction, including *
7
* without limitation the rights to use, copy, modify, merge, publish, *
8
* distribute, distribute with modifications, sublicense, and/or sell *
9
* copies of the Software, and to permit persons to whom the Software is *
10
* furnished to do so, subject to the following conditions: *
11
* *
12
* The above copyright notice and this permission notice should not be *
13
* deleted from the source form of the Software. *
14
* *
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22
* *
23
* Except as contained in this notice, the name(s) of the above copyright *
24
* holders shall not be used in advertising or otherwise to promote the *
25
* sale, use or other dealings in this Software without prior written *
26
* authorization. *
27
****************************************************************************/
28
29
/****************************************************************************
30
* Author: Medine, Yasin 2022-on *
31
****************************************************************************/
32
/*
33
*
34
* gGUIImageButton.h
35
*
36
* Created on: 21 Tem 2022
37
* Author: Medine, Yasin
38
*/
39
40
#ifndef UI_GGUIIMAGEBUTTONH
41
#define UI_GGUIIMAGEBUTTONH
42
43
#include "
gGUIButton.h
"
44
#include "
gImage.h
"
45
46
53
class
gGUIImageButton
:
public
gGUIButton
{
54
public
:
55
gGUIImageButton
();
56
virtual
~gGUIImageButton
();
57
58
void
draw
();
59
65
void
loadButtonImages
(
const
std::string& imagePath);
66
75
void
loadPressedButtonImages
(
const
std::string& imagePath);
76
82
void
setButtonImage
(
gImage
setImage);
83
90
void
setPressedButtonImage
(
gImage
setImage);
91
97
void
setImageStretched
(
bool
stretch);
98
103
std::string
getButtonImagePath
();
104
110
std::string
getPressedButtonImagePath
();
111
115
int
getButtonWidth
();
116
120
int
getButtonHeight
();
121
125
void
setButtonImageFromIcon
(
int
iconId,
bool
isIconBig =
false
);
126
130
void
setPressedButtonImageFromIcon
(
int
pressedIconId,
bool
isIconBig =
false
);
131
132
133
private
:
134
float
imagew, imageh, proportion;
135
bool
stretch, isiconbig;
136
std::string buttonimagepath;
137
std::string pressedbuttonimagepath;
138
gImage
buttonimage;
139
gImage
pressedbuttonimage;
140
141
int
iconid;
142
int
pressediconid;
143
};
144
145
#endif
/* UI_GGUIIMAGEBUTTONH */
gGUIButton
Definition
gGUIButton.h:14
gGUIImageButton
Definition
gGUIImageButton.h:53
gGUIImageButton::getButtonWidth
int getButtonWidth()
gGUIImageButton::setPressedButtonImage
void setPressedButtonImage(gImage setImage)
gGUIImageButton::setButtonImage
void setButtonImage(gImage setImage)
gGUIImageButton::getButtonHeight
int getButtonHeight()
gGUIImageButton::draw
void draw()
gGUIImageButton::loadButtonImages
void loadButtonImages(const std::string &imagePath)
gGUIImageButton::getButtonImagePath
std::string getButtonImagePath()
gGUIImageButton::setPressedButtonImageFromIcon
void setPressedButtonImageFromIcon(int pressedIconId, bool isIconBig=false)
gGUIImageButton::loadPressedButtonImages
void loadPressedButtonImages(const std::string &imagePath)
gGUIImageButton::setButtonImageFromIcon
void setButtonImageFromIcon(int iconId, bool isIconBig=false)
gGUIImageButton::gGUIImageButton
gGUIImageButton()
gGUIImageButton::getPressedButtonImagePath
std::string getPressedButtonImagePath()
gGUIImageButton::~gGUIImageButton
virtual ~gGUIImageButton()
gGUIImageButton::setImageStretched
void setImageStretched(bool stretch)
gImage
Definition
gImage.h:34
gGUIButton.h
gImage.h
engine
ui
gGUIImageButton.h
Generated by
1.9.8