summaryrefslogtreecommitdiff
path: root/scene/gui/texture_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/texture_button.cpp')
-rw-r--r--scene/gui/texture_button.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index 5f2e4cf58e..325b9d00ed 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -33,7 +33,6 @@
#include <stdlib.h>
Size2 TextureButton::get_minimum_size() const {
-
Size2 rscale = Control::get_minimum_size();
if (!expand) {
@@ -57,9 +56,7 @@ Size2 TextureButton::get_minimum_size() const {
}
bool TextureButton::has_point(const Point2 &p_point) const {
-
if (click_mask.is_valid()) {
-
Point2 point = p_point;
Rect2 rect = Rect2();
Size2 mask_size = click_mask->get_size();
@@ -116,9 +113,7 @@ bool TextureButton::has_point(const Point2 &p_point) const {
}
void TextureButton::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_DRAW: {
DrawMode draw_mode = get_draw_mode();
@@ -126,13 +121,11 @@ void TextureButton::_notification(int p_what) {
switch (draw_mode) {
case DRAW_NORMAL: {
-
if (normal.is_valid())
texdraw = normal;
} break;
case DRAW_HOVER_PRESSED:
case DRAW_PRESSED: {
-
if (pressed.is_null()) {
if (hover.is_null()) {
if (normal.is_valid())
@@ -144,7 +137,6 @@ void TextureButton::_notification(int p_what) {
texdraw = pressed;
} break;
case DRAW_HOVER: {
-
if (hover.is_null()) {
if (pressed.is_valid() && is_pressed())
texdraw = pressed;
@@ -154,7 +146,6 @@ void TextureButton::_notification(int p_what) {
texdraw = hover;
} break;
case DRAW_DISABLED: {
-
if (disabled.is_null()) {
if (normal.is_valid())
texdraw = normal;
@@ -232,7 +223,6 @@ void TextureButton::_notification(int p_what) {
}
void TextureButton::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("set_normal_texture", "texture"), &TextureButton::set_normal_texture);
ClassDB::bind_method(D_METHOD("set_pressed_texture", "texture"), &TextureButton::set_pressed_texture);
ClassDB::bind_method(D_METHOD("set_hover_texture", "texture"), &TextureButton::set_hover_texture);
@@ -271,61 +261,49 @@ void TextureButton::_bind_methods() {
}
void TextureButton::set_normal_texture(const Ref<Texture2D> &p_normal) {
-
normal = p_normal;
update();
minimum_size_changed();
}
void TextureButton::set_pressed_texture(const Ref<Texture2D> &p_pressed) {
-
pressed = p_pressed;
update();
}
void TextureButton::set_hover_texture(const Ref<Texture2D> &p_hover) {
-
hover = p_hover;
update();
}
void TextureButton::set_disabled_texture(const Ref<Texture2D> &p_disabled) {
-
disabled = p_disabled;
update();
}
void TextureButton::set_click_mask(const Ref<BitMap> &p_click_mask) {
-
click_mask = p_click_mask;
update();
}
Ref<Texture2D> TextureButton::get_normal_texture() const {
-
return normal;
}
Ref<Texture2D> TextureButton::get_pressed_texture() const {
-
return pressed;
}
Ref<Texture2D> TextureButton::get_hover_texture() const {
-
return hover;
}
Ref<Texture2D> TextureButton::get_disabled_texture() const {
-
return disabled;
}
Ref<BitMap> TextureButton::get_click_mask() const {
-
return click_mask;
}
Ref<Texture2D> TextureButton::get_focused_texture() const {
-
return focused;
};
void TextureButton::set_focused_texture(const Ref<Texture2D> &p_focused) {
-
focused = p_focused;
};