animator.graphics.shader.Shader¶
- class animator.graphics.shader.Shader(sksl: str)¶
Bases:
object
- __init__(sksl: str) None ¶
Create a shader from the given sksl code. If the sksl code is invalid, a
ValueError
will be raised.- Parameters
sksl – The sksl code for the shader.
Methods
__init__
(sksl)Create a shader from the given sksl code.
build
()Build the shader.
from_file
(path)Create a shader from the given file path.
get_child
(name)Get the child with the given name.
get_uniform
(name)Get the uniform with the given name.
Attributes
The shader's builder, useful for building runtime shader image filters.
Names of the shader's children.
Names of the shader's uniforms.
- build() animator.skia.Shader ¶
Build the shader.
- property builder: animator.skia.RuntimeShaderBuilder¶
The shader’s builder, useful for building runtime shader image filters.
- classmethod from_file(path: str) animator.graphics.shader.Shader ¶
Create a shader from the given file path.
- get_child(name: str) animator.skia.RuntimeEffectBuilder.BuilderChild ¶
Get the child with the given name. Call
skia.RuntimeEffectBuilder.BuilderChild.set()
on the returned object to set the child’s value.