智能客服
你问我答,随时在线为你解决问题
导入模块。
import { hdsEffect } from '@kit.UIDesignKit'; 设置背景流光效果。
@Entry
@Component
struct UVFlowLight {
@State controller: hdsEffect.ShaderEffectController = new hdsEffect.ShaderEffectController();
build() {
Stack() {
}
.visualEffect(new hdsEffect.HdsEffectBuilder()
.shaderEffect({
effectType: hdsEffect.EffectType.UV_BACKGROUND_FLOW_LIGHT,
animation: {
duration: 10000,
iterations: -1,
autoPlay: true,
onFinish: ()=> {
console.info('Succeeded in finishing');
}
},
controller: this.controller
})
.buildEffect())
.width('100%')
.height('100%')
}
} 