全局透明度: &透明度 0.8
controls:
转data:
val: "data"
type: Canvas
attribute:
alpha: *透明度
adaptive:
type: adaptive
attribute:
point: ~bottom_left
width: 1920
height: 1080
children:
组件:
type: texture
attribute:
width: 700
height: 400
normal: ~255,255,255
alpha: 0.8*val.data.alpha
这样当然可以解决问题,但不可避免的需要向所有组件手动添加alpha属性现在可以实现的其实..
主要通过Yaml锚点的调用和组件data实现
YAML:全局透明度: &透明度 0.8 controls: 转data: val: "data" type: Canvas attribute: alpha: *透明度 adaptive: type: adaptive attribute: point: ~bottom_left width: 1920 height: 1080 children: 组件: type: texture attribute: width: 700 height: 400 normal: ~255,255,255 alpha: 0.8*val.data.alpha