postProcess property
PostProcess?
get
postProcess
A PostProcess
that is applied to the world of a camera.
Do note that only one postProcess can be active on the camera at once. If the postProcess is set to null, the previous post process will be removed. If the postProcess is set to not null, it will be added to the camera, and any previously active post process will be removed.
See also:
PostProcess
for the base class for post processes and more information about how to create them.PostProcessComponent
for a component that can be used to apply a post process to a specific component.
Implementation
PostProcess? get postProcess =>
children.query<PostProcessComponent>().firstOrNull?.postProcess;
set
postProcess
(PostProcess? postProcess)
Implementation
set postProcess(PostProcess? postProcess) {
final postProcessComponents = children
.query<PostProcessComponent>()
.toList();
final queuedPostProcessAdds = findGame()?.queue
.where(
(event) =>
event.kind == LifecycleEventKind.add &&
event.child is PostProcessComponent,
)
.map((event) => event.child!);
removeAll([...postProcessComponents, ...?queuedPostProcessAdds]);
if (postProcess != null) {
add(PostProcessComponent(postProcess: postProcess));
}
}