Theme applies in editor but not in game
Asked Answered
C

3

0

Hello! I have a weird issue where my custom tres theme for some buttons applies correctly in the 2D editor, but in the actual game the theme isn't visible. This happens even after restarting Godot.

I tried googling the issue and couldn't find a solution that worked for me since most people seem to report the other way around - theme works in game but not in the editor.

I have tried applying the theme to the root control node, the button itself, and both.

Game (left) vs editor (right)

Theme applied to root control node from a saved tres

The theme has the same settings for all states of the button

Kinda stumped and would appreciate suggestions, thanks!

Couthie answered 23/8, 2023 at 10:58 Comment(0)
B
0

Probably did this but have you tried removing the theme and then reapplying it? Sometimes I find that the project/theme files seem to get into an out of sync state.

Banian answered 23/8, 2023 at 12:36 Comment(0)
C
0

A good suggestion, I just tried it but it doesn't seem to have fixed the issue. I removed the theme from the individual buttons and the control node, saved, then re-added the theme to the control node and saved.

Couthie answered 23/8, 2023 at 13:19 Comment(0)
C
0

So I identified the issue which I'll post here in the unlikely event this happens to another person. My game has two font options, default and Open Dyslexic. The way the game changes fonts is by iterating over all nodes that can take a theme and giving them one or the other font theme. This was overwriting my custom button themes 😰

Couthie answered 23/8, 2023 at 14:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.