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
54public:
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
91
97 void setImageStretched(bool stretch);
98
103 std::string getButtonImagePath();
104
111
116
121
125 void setButtonImageFromIcon(int iconId, bool isIconBig = false);
126
130 void setPressedButtonImageFromIcon(int pressedIconId, bool isIconBig = false);
131
132
133private:
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 */
Definition gGUIButton.h:14
Definition gGUIImageButton.h:53
void setPressedButtonImage(gImage setImage)
void setButtonImage(gImage setImage)
void loadButtonImages(const std::string &imagePath)
std::string getButtonImagePath()
void setPressedButtonImageFromIcon(int pressedIconId, bool isIconBig=false)
void loadPressedButtonImages(const std::string &imagePath)
void setButtonImageFromIcon(int iconId, bool isIconBig=false)
std::string getPressedButtonImagePath()
virtual ~gGUIImageButton()
void setImageStretched(bool stretch)
Definition gImage.h:34