Difference between visible and activated

Hello how are you?.

I’ve been using Defold for a few years now, I’ve had big surprises and some frustrating moments, but I’m still here!.

Today, I want to ask you what do you understand by Visible and what do you understand by Activated?.(Only serious answers!)

Logic:

If a button in the GUI node is visible it is seen and if you code it to press it works, if you make it Not visible it is not seen and It does not work, even with the code written!.

If that same button is deactivated it is seen and no matter how many clicks you give it does not work, even with the code written!.

In Defold that logic doesn’t exist!.

To do this, watch the video in detail and you will understand!.

What is the difference between visible and activated?. (Serious answers, no links to “Native extensions”!)

PS. Part of the code used in the example Button

Sometimes you need a node that you can animate and treat like a regular node, but without rendering it. For example, for anchors or invisible click areas. In such cases, you turn visibility off.

If you want to fully deactivate a node, stop updating it, and use gui.is_enabled() to check whether it should be interactive, meaning whether the button is logically active or not, then you use the enabled flag.

2 Likes

For invisible click areas I don’t depend on the graphical interface!

If the button is fully disabled with (gui.set_enabled(“button”, false) ), and verified with (gui.is_enabled(“button”))…

Captura desde 2026-03-01 12-24-58

Why doesn’t it look and if it’s deactivated, why does clicking it work?

We don’t have such a function as “clicking”. I think you are talking about gui.pick_node() which

determines if the node is pickable by the supplied coordinates

and nothing else.

so if you need to check if node is enabled you should use it together with gui.is_enabled()

if gui.is_enabled(self.btn_my) and gui.pick_node(self.btn_my) then
...
end

Sometimes it is necessary for a button’s clickable area to be larger than its visible graphics. It is common practice to define a clickable area that is independent of the button’s actual visuals. In such cases, invisible nodes used solely to control transform parameters are very useful.

Similarly, when creating a node for anchoring, this is a good example of that approach: How to GUI in Defold

In the past, developers often used a node with a small 2x2 alpha texture, which was neither convenient nor efficient due to overdraw. The visibility checkbox offers a much cleaner and more efficient solution.

With this it is clear to me the visibility of a button, Thank you for it!

I apply this code to the visibility of the button!

If I want to create a level screen I need an activated button and other buttons disabled and visible!

Why force non-visibility when disabled? (No links to “Native extensions”, Please)

Defold does not provide a high-level concept such as a button.
Instead, it offers nodes that can be used to build any higher-level components.

A node can be enabled or disabled, which affects:

  • updates
  • visibility

It can also be set to visible or invisible, which only affects visibility.

If you need a node to continue updating while remaining invisible, use the visibility toggle. If you want to fully disable a node, use the Enable toggle.

You cannot directly equate disabling a button with disabling a node, but you can implement button disabling by using this functionality.

It feels like there is some irony that you keep emphasizing, and I have tried to ignore it. However, since you continue to push it, I decided to respond.

Defold is a minimalistic and modular engine. Our goal is to keep it as minimal and as modular as possible, which is the opposite of the “all in one” approach.

We will continue developing it in this direction, as this is what makes Defold stand out compared to other engines that follow a monolithic “all in one” model. In this context, providing a library or extension as a solution is just as natural for Defold as adding a new API in an update is for some other engines.

4 Likes

With each answer you offer me the capabilities of the engine you develop without the need to resort to a third party, with this I form a criterion that will help me decide if I depend on that third party!

1 Like