#problem with gui_input

49 messages · Page 1 of 1 (latest)

hearty coyote
#

sounds like you have some other UI/2D Node above it that stops the imputs. Probably one set to full rectangle.

mighty stratus
hearty coyote
#

it is No it's the other way around, and all CanvasItems can also add z-offset. CanvalsLayers also have it set to a higher value by default if i remember correctly.

mighty stratus
hearty coyote
#

as long as you don't call accept_event() inside the ones set to pass it should be fine.

#

do you have the VBoxContainer and Labels of the Upgrade Card set to pass/ignore?

#

those are also in front of the node you want to get the input from.

mighty stratus
hearty coyote
mighty stratus
#

nope

hearty coyote
#

try launching the ability_upgrade_card-scene on it's own (F6) and try if it works.

mighty stratus
#

no, it doesn't, added a breakpoint on the on_gui_input func, and didnt get there

#

okay

#

fixed it so the scene alone works

#

but in full game still not working

hearty coyote
#

what did you change?

mighty stratus
#

I put the panelcontainer mouse input on 'stop'

#

panelcontainer, AbilityUpgradeCard

hearty coyote
#

how are you checking if the panel got clicked?

mighty stratus
#

like this, with the gui_input

#

so I initialised a child of abilityupgradecard inside upgrade_screen and ran the current screen upgrade_sceen, and this also worked fine.

hearty coyote
#

i really don't know anymore. the last thing to try would be to use the _gui_input()-virtual Function instead.

mighty stratus
#

tried that, still doesnt work.

#

np man, thanks for the help

#

will maybe just go back into my git and try to test it step by step, and checking what could be the problem

hearty coyote
#

that's will probably be the only way to pin down what causes this.

#

good luck

mighty stratus
#

thanks mate, and for the help

hearty coyote
#

and then get it's NodePath with get_path() to find it in your tree.

mighty stratus
#

okay, added it and when i hover over my upgrade_card i get this instead

Currently hovering over 660: MarginContainer

  • Path: /root/Main/Users/User/player/PlayerUI/2D UI/MarginContainer
  • Instance ID: 48922363343
#

so it doesnt detect my upgrade card on top

hearty coyote
#

i had the feeling that it might have something to do with the CanvasLayer hidden inside your player scene.
But it's still weird since you said that your upgrade card is displayed on top.

mighty stratus
#

the game looks like this

there is nothing in the middle of the screen, only the cards, so hard to tell when playing if the cards or the playerUI/2d ui is in front

hearty coyote
#

well it doesn't look like it's in front, and it shouldn't be as long as the layer index is smaller.

#

and you said that you set it to the one for the upgrades to the limit.

mighty stratus
#

yes, i put the margincontainer inside UpgradeScreen on 4096 and AbilityUpgradeCard also on 4096

hearty coyote
#

that last one shouldn't be necessary, but yeah, no idea why the player ui takes the input. do you need that one to capture gui_events? Else probably disable them to be safe.

mighty stratus
#

fixed

#

put the mouse filter of the margincontainer inside the 2dUI on ignore

#

does the trick

#

is possible that i will need mouse input in the 2dui but that are problems for later

hearty coyote
#

glad to hear. might have something to do with having ui as a child of 3d-nodes, but that isn't really my territory and still sounds like a weird reason.

mighty stratus
#

yups, will maybe add the upgrade_screen and cards to my player_ui instead of under my upgrademanager

#

but still happy it works now

hearty coyote
#

if you want to add ui to your player you could use Camera3D.unproject_position() to get the 2D-position on screen. i also have the feeling that's the only way to make ui follow an object in 3d.

#

or just keep it static if the player always stays in the center.