mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
[StatusIndicator] Add method to get indicator icon screen rect.
This commit is contained in:
parent
a0b0b19043
commit
e5205e589f
10 changed files with 86 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ void StatusIndicator::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("is_visible"), &StatusIndicator::is_visible);
|
||||
ClassDB::bind_method(D_METHOD("set_menu", "menu"), &StatusIndicator::set_menu);
|
||||
ClassDB::bind_method(D_METHOD("get_menu"), &StatusIndicator::get_menu);
|
||||
ClassDB::bind_method(D_METHOD("get_rect"), &StatusIndicator::get_rect);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("pressed", PropertyInfo(Variant::INT, "mouse_button"), PropertyInfo(Variant::VECTOR2I, "mouse_position")));
|
||||
|
||||
|
|
@ -182,3 +183,10 @@ void StatusIndicator::set_visible(bool p_visible) {
|
|||
bool StatusIndicator::is_visible() const {
|
||||
return visible;
|
||||
}
|
||||
|
||||
Rect2 StatusIndicator::get_rect() const {
|
||||
if (iid == DisplayServer::INVALID_INDICATOR_ID) {
|
||||
return Rect2();
|
||||
}
|
||||
return DisplayServer::get_singleton()->status_indicator_get_rect(iid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue