Gui text node inherit alpha works in editor, broken at runtime (solved)

I’ve tried building a minimal repro project, but the simple version of this works as expected. Before I dive even deeper to try to nudge the repro towards greater complexity (nesting, order of execution, etc), I hoped someone here might have a suggestion for me.

I’m trying to set a container gui node in a template (“outline”) to an opacity of 0.5 to signify “unfocused.” The container’s text child node has “inherit alpha” enabled. In the IDE, this works as expected:

However, at runtime, while the outline alpha stays the same (you can see it’s half opaque), the text becomes fully opaque:

I thought maybe there was some side-effect from a script or something, so I created an empty test collection with a single go with a single gui component referencing the same gui file, with its script deleted so it’s just static. Same issue.

For reference, the minimal repro looks identical in the IDE & at runtime:

I’m labelling this a “bug” because alpha inheritance should work identically between IDE and runtime, but since I can’t easily reproduce it, it’s likely a side-effect of something else: a project-wide setting? a corrupted file?

I went node-by-node in the tree and made my repro case exactly match, until I found the issue:

GUI Templates have an “inherit_alpha” value as well, that appears to override or partially override that value in any nodes created via the template.

This is super confusing since the defold manual specifically calls out:

The template instance is listed as a collapsible entry in the Outline view. However, it is important to note that this item in the outline is not a node. The template instance does not exist in runtime either, but all nodes that are part of the instance does.

I don’t understand how/why something that isn’t a node and doesn’t exist at runtime, has its own “inherit alpha” property: what exactly does that property apply to? Does it override all such values on any children created with that template? Why does its runtime behavior not match its IDE behavior?

1 Like