-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In node (Menu Button) is not running, the function (is_pressed ()) and in any case returns false ... #5000
Comments
It's hard to tell what the issue is about. Could you elaborate a bit more? |
Somebody just got a get! button.connect("clicked", self, "_on_button_clicked")
func _on_button_clicked():
print("Yeeeee!!!") Should do the trick. If you need to set flag, set it from signal handler. |
Of course I spent testing, and the button is clearly working, it can be seen because the pop-up menu appears after pressing, but the function does not return the truth ... I have a lot of simple (buttons), and in them, this function works properly, but at (menu button) no ... |
The pressed state is probably list between frames or reset immediately by the extends MenuButton
func _ready():
set_process(true)
set_fixed_process(true)
connect("pressed", self, "_on_pressed")
func _process(delta):
if is_pressed():
prints("_process: is_pressed() is True")
func _fixed_process(delta):
if is_pressed():
prints("_fixed_process: is_pressed() is True")
func _on_pressed():
prints("_on_pressed: is_pressed() is", str(is_pressed())) In my tests, So the correct way is to use this signal, like @slapin mentioned (although he wrote |
Well, anyway, it is better to use signals which is my point. |
guys let's not deviate from the topic, I have to inform you that there is "door stuck" and you offer me "climb up through the window," but it did not fix the bug, and I need exactly this function, instead of a signal ... =) |
@OlexiyKravchuk The reason it's not working is because the button loses focus right after clicking it (since the |
@neikeq It is very strange behavior that immediately menu captures focus. But I see another problem in the node (pop up menu) for some reason it does not want to become invisible when I call it a function hide (), and the same problem I see in all nodes inherit from the node (pop up) |
That's weird. The PopupMenu should appear on mouse pressed, not released (at least it does so for me). |
as I said, to work around this problem, I had to invent a "new wheel" instead of using the standard version of the node, but there I got another problem, which is now in the node (popup menu),. |
You should have started from there :P |
@neikeq By the way (option button) works properly and function (is pressed) there, also works great, just as I have described before, and although it is almost the same as the (menu button) but at the (menu button), this functionality is broken ... |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
In node (Menu Button) is not running, the function (is_pressed ()) and in any case returns false ...
The text was updated successfully, but these errors were encountered: