无法将主题更改传递给子节点

huangapple go评论64阅读模式
英文:

Can't pass theme changes to children nodes

问题

我理论上应该能够更改任何控件节点(按钮、面板等)的字体、纹理等,只要我将它们全部放在一个统一的父控件节点下,并为该父节点添加一个独特的主题。然而,对我来说实际上并不起作用。请看图片。

无法将主题更改传递给子节点

Main 在检查器中设置了主题。它具有全新的全局字体和更改后的按钮和面板纹理。
绿色 - 字体和纹理已更改
黄色 - 部分更改(在面板的情况下,字体已更改,但纹理没有更改)
红色 - 没有更改字体
目前,我只有两件事要更改:字体和纹理。如果纹理'大多'能够工作(我无法使面板纹理更改),字体就更有问题。

所以,基本上按钮的纹理会更改,但面板不会。只有选项按钮和面板会更改字体,而普通按钮不会。

我做错了什么?

英文:

In theory I should be able to change font, textures, etc. of any control node (buttons, panels, and others) if I place all of them under a unifying parent control node and add a unique theme to that parent. However, it doesn't really work for me. See the pic.

无法将主题更改传递给子节点

Main has the theme set in the Inspector. It has a new global font and changed textures for buttons and panels.
Green - font and texture got changed
Yellow - changed partially (in case of Panel, the font is changed, but not the texture)
Red - no font changes
For now, I've got only two things to change: fonts and textures. And if textures 'mostly' work (I can't get Panel textures to change), font is more problematic.

So, basically buttons get changed in textures, but not panels. Only option buttons and panels get changed fonts, but not normal buttons.

What am I doing wrong?

答案1

得分: 0

对于将来遇到类似问题的人:如果你正在为一个主题设置全局更改,并希望它在所有受影响的元素中可见,请检查是否不小心为特定元素设置了特定内容。

换句话说,如果按钮具有设置的字体,它将不会使用你为主题设置的默认字体。

更具体地说,转到主题编辑器,选择你正在编辑的对象,选择字体,然后点击那里看到的删除按钮(如果有的话),以使用你设置的默认字体来应用到整个主题。

英文:

For those with the similar problem in the future: if you are setting a global change for a theme and you want it to be visible in all affected elements, check if you have not accidentally set something specific for a specific element.

In other words, if a button has a set font, it will not use the default font you set for the theme.

In even otherier words, go to the Theme editor, chose the object you're editing, Fonts, and click the Delete button you see there (if it is there) to use the fonts you set as default for the whole theme.

huangapple
  • 本文由 发表于 2023年7月23日 14:21:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76746871.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定