I had a setup with nested CanvasLayer nodes. Toggling the visibility of the root CanvasLayer doesn’t hide any nested CanvasLayer nodes. My solution was to listen to the visibility_changed signal, find any CanvasLayer child nodes, and apply the same visibility to them.
func_ready() -> void:# If the visibility changes, apply it to any nested CanvasLayer nodes.visibility_changed.connect(func() -> void:find_children("*","CanvasLayer",true,false).map(func(node:CanvasLayer) -> void:node.visible=visible))
This inventory system release refines a lot of architecture guide sections based on customer feedback and adds over 100 additional pages to the PDF guide. Features: Bug fixes:
Godot-matcha is an addon that lets you use WebRTC for multiplayer games by handling matchmaking using WebTorrent trackers. Conceptually it’s quite an interesting, novel approach. WebTorrent uses a modified BitTorrent protocol that allows it to work with WebSockets. A WebTorrent tracker is essentially a directory service that keeps track of torrents offered by users. A …
Arguably, more fun than writing code is removing code. I was assembling a split-screen multiplayer UI. The goal behavior is to show/hide the appropriate displays for the players, depending on how many players there are. Initially, the code to update the UI was very simple, because I started with two players. In that case, you …
Toggling Visibility of Nested CanvasLayers
I had a setup with nested CanvasLayer nodes. Toggling the visibility of the root CanvasLayer doesn’t hide any nested CanvasLayer nodes. My solution was to listen to the visibility_changed signal, find any CanvasLayer child nodes, and apply the same visibility to them.
Related Posts
Inventory System v1.2 available
A few new features: Bug fixes:
Inventory System v1.15 available
This inventory system release refines a lot of architecture guide sections based on customer feedback and adds over 100 additional pages to the PDF guide. Features: Bug fixes:
godot-matcha: Free multiplayer without a server
Godot-matcha is an addon that lets you use WebRTC for multiplayer games by handling matchmaking using WebTorrent trackers. Conceptually it’s quite an interesting, novel approach. WebTorrent uses a modified BitTorrent protocol that allows it to work with WebSockets. A WebTorrent tracker is essentially a directory service that keeps track of torrents offered by users. A …
A GDScript refactoring exercise
Arguably, more fun than writing code is removing code. I was assembling a split-screen multiplayer UI. The goal behavior is to show/hide the appropriate displays for the players, depending on how many players there are. Initially, the code to update the UI was very simple, because I started with two players. In that case, you …