I have been working on a hidden object game for a while and I'm now at the point where I wanted to implement game pausing.
Reading the Godot 3.1 docs, I thought it would be fairly simple to do, but I hit a snag ...
When I click the pause btn (yellow), and I then click a creature (red), nothing happens (which is what I expect). But if I then unpause the game, I can see that the click on the creature has actually registered and processing is only postponed, not ignored. I assume this is a Godot bug ... but does anyone have any suggestions on how I can work around this issue for now ?
SceneTree : GameRoot : has child Scene (with creatures ; everything above pink rect) Scene : has child Bar (with buttons ; everything inside pink rect)
Pause btn : A TextureButton with the pause-mode set to 'process' in the editor. Its code :
func _on_pause_btn_up():
is_paused = !is_paused
get_tree().set_deferred("paused", is_paused)
Creatures : Created as an Area2D with 2 children : a Sprite and a CollisionPolygon2D. They register clicks like this :
func on_LMB(viewport, event, shape_idx, creature_p:Area2D):
if(event.is_action_released("LMB")):
emit_signal("clicked", creature_p)
(This is Godot 3.1.1 on Windows 10.)